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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Or in another words, I want to get a related-posts from other category (or categories) than the category held by the post.

    Plugin Author jeffparker

    (@jeffparker)

    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.

    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
    )); 
    
    ?>
    Plugin Author jeffparker

    (@jeffparker)

    What happens if you use the following instead?

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

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

    Still unresolved. Anybody can help me about this? 🙁

    Plugin Author jeffparker

    (@jeffparker)

    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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How do I exclude the related-post from a specific category (or categories)?’ is closed to new replies.