- This topic has 3 replies, 2 voices, and was last updated 9 years, 6 months ago by Theme Horse Support Team.
-
AuthorPosts
-
March 7, 2015 at 6:11 am #22839nshimerParticipant
I have content-extensions.php in a child theme and have modified ultimate_theloop_for_template_blog_image_large
if( is_page('86') ){ $blog_query = new WP_Query( array('cat' => '6', 'post_type' => 'post', 'paged' => $paged ) ); }else{ $blog_query = new WP_Query( array('post_type' => 'post', 'paged' => $paged ) ); }
This works correctly and only returns category 6 posts as expected. The problem is with the:
ultimate<?php next_posts_link( __( '« Previous', 'ultimate' ), $wp_query->max_num_pages ); ?>
and the:
ultimate<?php previous_post_link( __( 'Next »', 'ultimate' ), $wp_query->max_num_pages ); ?>
The previous and next show all posts not just the categorized. What am I missing here? I thought that the max_num_pages returned only from the current query but it seems to be returning all posts not just the category num of posts. What should I do to be able to only show previous and next from the category 6?March 9, 2015 at 5:13 am #22887Theme Horse Support TeamKeymasterHi nshimer,
Actually you need to hire a developer to fix it. We only help to solve the theme relating issue. Just once try the below code, it may also help you too.
<?php if ( in_category('6'): // 6 is the category id change it?> ultimate <?php previous_post_link('« %link', 'previous', true) ?> ultimate<?php next_post_link('%link »', 'next', true) ?> <?php endif; ?>
Thank you!
March 12, 2015 at 11:40 pm #23034nshimerParticipantActually I think _post_link might work thanks for the reply!
March 13, 2015 at 5:52 am #23047Theme Horse Support TeamKeymasterYou welcome nshimer
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.