WordPress.org

Forums

Yet Another Related Posts Plugin (YARPP)
How do I exclude the related-post from a specific category (or categories)? (8 posts)

  1. array064
    Member
    Posted 1 year ago #

    How do I exclude the related-post from a specific category (or categories)? Especially when I use the yarpp_related() function.

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

  2. array064
    Member
    Posted 1 year ago #

    Or in another words, I want to get a related-posts from other category (or categories) than the category held by the post.

  3. jeffparker
    Member
    Plugin Author

    Posted 1 year ago #

    You can use "The Pool" panel to disallow certain categories from displaying.

    If the algorithm determines that there are better matches to your post from other categories, it will display them. You might want to tweak the settings in the "Relatedness" panel until you're satisfied with the results.

    Both of these panels can be found in the top "Screen Options" tab.

  4. array064
    Member
    Posted 1 year ago #

    Thank you. But what I ask is: how to do this if using yarpp_related() function in my source code?

    I have tried to do it like this, but the result was not as I expected (posts on the excluded categories still remains on the related-post output):

    <?php
    
    yarpp_related(array(
    	'post_type' => array('post'),
    	'show_pass_post' => false,
    	'past_only' => false,
    	'exclude' => array(
    		'category' => array(12,17375,2041)
    	),
    	'recent' => false
    )); 
    
    ?>
  5. jeffparker
    Member
    Plugin Author

    Posted 1 year ago #

    What happens if you use the following instead?

    'exclude' => array(12,17375,2041)

  6. array064
    Member
    Posted 1 year ago #

    I've tried your advice, but the result is the same: posts on the excluded categories still remains on the related-post output.

  7. array064
    Member
    Posted 1 year ago #

    Still unresolved. Anybody can help me about this? :(

  8. jeffparker
    Member
    Plugin Author

    Posted 1 year ago #

    Can you first check that you can successfully exclude categories through the UI rather than the yarpp_related() function? If so, can you confirm that those are the correct taxonomy IDs?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.