✔ Style out the category Pages
Completed by Kyle S.
- Assigned to
-
Kyle S.
- Notes
-
Style out the category pages. Right now, no posts display even if they are in the category. Thanks.
Here's the hacky code I created to show the content in these Category Archives.
<?php if(have_posts()) : if(get_queried_object() -> slug === "news-events") : $today = date( 'Y-m-d' ); ?> <div class="resultContainer limit-width limit-max-width"> <?= do_shortcode('[ajax_load_more container_type="div" post_type="post" posts_per_page="6" category="'. get_queried_object() -> slug .'" meta_key="the_date" meta_value="'. $today .'" meta_compare=">=" meta_type="DATE" order="ASC" orderby="meta_value"]'); ?> </div> <div class="resultContainer limit-width limit-max-width"> <?= do_shortcode('[ajax_load_more container_type="div" post_type="post" posts_per_page="6" category="'. get_queried_object() -> slug .'" order="DESC" orderby="publish_date"]'); # meta_key="the_date" meta_compare="NOT EXISTS" ?> </div> <?php else : ?> <div class="resultContainer limit-width limit-max-width"> <?= do_shortcode('[ajax_load_more container_type="div" post_type="post" posts_per_page="6" category="'. get_queried_object() -> slug .'" order="DESC" orderby="publish_date"]'); ?> </div> <?php endif; ?> <?php else : get_template_part( 'template-parts/content', 'none' ); endif;My recommendation is to split News into its own category and Events into its own category (or CPT).