• Thank you for the wonderful plugin!

    Because my next/previous posts look exactly the same as my related posts stylistically, I’d like to disable the next and/or previous posts from being displayed in my related posts area.

    I hope that makes sense.

    Is yarpp capable of knowing what the previous and next posts are? And if so, how would I tell yarpp not to display those posts in particular?

    Here’s hoping there is an easy solution! 🙂

    https://wordpress.org/plugins/yet-another-related-posts-plugin/

Viewing 1 replies (of 1 total)
  • Thread Starter carolemagouirk

    (@carolemagouirk)

    I added this above the loop:

    $exclude = get_the_category();
    $exclude = $exclude[0]->cat_ID;
    
    $wp_query = new WP_Query( array('category__not_in' => array($exclude), 'posts_per_page' => 4) );

    Which half works. The next/previous posts are disabled, but so are all of the posts for that category.

    It’s not ideal, but it’ll do for now.

Viewing 1 replies (of 1 total)
  • The topic ‘Disable next post in category’ is closed to new replies.