• Resolved misscatherine

    (@misscatherine)


    I’ve seen this question asked and solved for others, but the solutions offered don’t work for me.

    I would like the previous/next navigation links at the bottom of a single post to be limited to the same category. At the moment it is going through posts in chronological order.

    I suspect I will need to add code to my Child Theme functions.php? Can someone please provide the appropriate snippet?

    My site is using Beaver Builder Child Theme. At Beaver Builder Support, they just want me to fork out more money to buy their Themer plugin to resolve this issue.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter misscatherine

    (@misscatherine)

    I found part of the solution. The appropriate links appear by adding the following snippet to the child theme single.php:

    <?php
    
    the_post_navigation( array(
    
    'prev_text' => '<div class="nav-previous"><span class="nav-subtitle">' . esc_html__( '←' ) . '</span> <span class="nav-title">%title</span></div>',
    
    'next_text' => '<div class="nav-next"><span class="nav-subtitle">' . esc_html__( '→' ) . '</span> <span class="nav-title">%title</span></div>',
    
    'taxonomy' => 'category',
    
    'in_same_term' => true,
    
    ) );
    
    ?>

    Now I need to adjust the display because the links are showing below the footer without any padding. Can someone explain how I can fine tune the display?

    Revert the changes you have already made and add this to child theme functions

    add_filter( 'fl_post_navigation_same_term', '__return_true' );

    Thread Starter misscatherine

    (@misscatherine)

    Brilliant Simon!! Thank you so much, that little snippet works like a charm!! ??

    Hurray for this forum and the generous people that take the time to help others. ????

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restrict previous/next posts per category’ is closed to new replies.