WordPress.org

Support

Support » Plugins and Hacks » Yet Another Related Posts Plugin (YARPP) » [Resolved] Show related posts for specific categories (not FROM specific categories)

[Resolved] Show related posts for specific categories (not FROM specific categories)

  • Simple and clear question which I hope will get a simple and clear answer:

    When I show single posts from my ‘Products’ category, I want to show related posts with YARPP (default behaviour is ok).

    When I show single posts from my ‘Blog’ category, I DON’T want to show related posts (i.e. like YARPP did not even exist).

    How would I go ahead adding this functionality to my functions.php file (I use Genesis)? Please do not reply something generic like ‘use YARPP templates’ because it does not work for me – I need the actual code.

    Thanks!

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author jeffparker

    @jeffparker

    The easiest solution might be to use CSS to hide the YARPP content on your blog pages. Try adding the following to your theme’s CSS file:

    .category-blog .yarpp-related {display:none;}

    thanks jeffparker but it did now work at all (to my surprise because it seemed a very smart fix). Maybe because in single post view is not the same as category (i.e. archive) view??

    Plugin Author jeffparker

    @jeffparker

    Hmm… I did a test using your site and the YARPP content disappeared. Can you put the CSS in place and give me the URL and I’ll take a look?

    You might add !important just to be sure:

    .category-blog .yarpp-related {display:none !important;}

    Thank you so much for your help! I have added the !important; but still no luck! Examples:

    This post:
    http://ahead-hosting.com/2013/12/arab-news/
    is under the category ‘websites-for-sale’, it shows related posts just fine (bottom of the page of course).

    This post instead:
    http://ahead-hosting.com/2013/11/purchase-site-using-domain-name/
    belongs to the ‘blog’ category, but it still shows related posts.

    I have just flushed my W3 total cache.
    Thanks!

    Plugin Author jeffparker

    @jeffparker

    I don’t see that CSS added to the page. Are you sure you saved it to your blog’s CSS file? When I add it, that YARPP content disappears. Please check. Thanks.

    Sorry I had a CDN enabled via W3 Total cache and the css were being served by Amazon! I have now disabled the cache and your solution works! However, even though it does not show thumbnails anymore it still shows the words ‘Other posts you might be interested in’… Any idea how to get rid of these too?? 🙂
    Thanks again!

    Sorry again! Related posts and thumbnails still show, even disabling the cache. My mistake.

    Plugin Author jeffparker

    @jeffparker

    I don’t see the YARPP content on your blog pages: http://ahead-hosting.com/2013/11/purchase-site-using-domain-name/

    Can you make sure you empty your browser cache and take a look? Thanks.

    Sorry once again jeffparker…. I simply moved the CSS line that you kindly suggested from the bottom to the top of my style.css file and now everything works! This topic is solved and thank you again!!

    Plugin Author jeffparker

    @jeffparker

    Glad to hear!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Show related posts for specific categories (not FROM specific categories)’ is closed to new replies.
Skip to toolbar