I have a problem with Yoast and displaying my primary category alongside rest of the posts from that category.
Let's say I have 4 posts, all of them are
lorem category and one post has set
lorem as primary category. Currently the
lorem category page (
/category/lorem) displays only the three posts that aren't set as primary of its category.
I have in my
category.php a simply WP query:
<?php $current_category = single_cat_title('', false); ?> <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'category_name' => $current_category, 'paged' => $paged ); $query = new WP_Query($args); ?> <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?> /* do stuff */ <?php endwhile; endif; ?> <?php previous_posts_link(); ?> <?php next_posts_link(); ?>
How can I modify the current WP query to also include the primary category alongside with pagination?