• Resolved figure2

    (@figure2)


    Greetings. I created a child theme of the Elicit theme for a small business association. I then created a custom post type named “small_business” to display the member pages which uses a template I created from single.php. Here is an example: http://scasbog.raddaddesign.com/small_business/placeholder-business-1

    Each of these businesses is going to be in one or more categories. The text under the page title, “Business type: Business & Personal Services” displays the category.

    I would like to limit the posts navigation under the content to only posts in the current category.

    The navigation code on the single.php is different than the WordPress codex.

    How do I change the code below to limit the post navigation to the current category?

    <?php wp_link_pages( ); ?>
    
    	<?php if ($prev_link || $next_link): ?>
    
    	<div class="navigation" >
    		<div   class="singleright">
    		<p><?php esc_html_e('Next-> ', 'elicit'); ?><strong><?php echo $prev_link; ?></strong></p>
    		</div>
    
    		<div class="singleleft">
    		<p><strong><?php echo $next_link; ?></strong><?php esc_html_e(' <-Previous', 'elicit'); ?></p>
    		</div>
    	</div>
    
    	<?php endif; ?>

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit post navigation to posts in the same category’ is closed to new replies.