How to disable YARP on certain pages ?

[ad_1]

Plugin Author
yarpp

(@jeffparker)

Hi @vinceo00

There are currently a couple of options – listed in our FAQs:

How can I prevent the “related posts” list from displaying on specific posts?

Option 1:

On the edit post page, uncheck “Display Related Posts” in the YARPP box. Be sure to update or publish to save your changes.

Option 2:

Add <!--noyarpp--> to the HTML code of any post to prevent related posts from displaying.

Option 3:

Use the noyarpp filter. For example:


// Disable YARPP Automatic Display in specific categories
function yarpp_disable_categories() {
  // Examples of in_category usage: 
  if ( in_category( array( 'my_category_1_slug', 'my_category_2_slug' ) ) ) {
    return true;
  }
}
add_filter( 'noyarpp', 'yarpp_disable_categories' );

These solutions only work if you are using “Automatic Display” in the “Display Options” section. If you are programmatically calling yarpp_related(), the shortcode [yarpp] from PHP code or the YARPP Block, you will need to do your own conditional checks.`

Thank you very much for your realiable and quick answer 🙂
Works great!

Plugin Author
yarpp

(@jeffparker)

You’re very welcome! 🙂

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer