Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

template_blog_image_large next and previous by category?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #22839

    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 ) );
    		$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( __( '&laquo; Previous', 'ultimate' ), $wp_query->max_num_pages ); ?>
    and the:
    ultimate<?php previous_post_link( __( 'Next &raquo;', '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?


    Hi 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('&laquo; %link', 'previous', true) ?>
    		ultimate<?php next_post_link('%link &raquo;', 'next', true) ?>
    <?php endif; ?>

    Thank you!


    Actually I think _post_link might work thanks for the reply!


    You welcome nshimer

    Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.