WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] Show related posts for specific categories (not FROM specific categories) (11 posts)

  1. paravia
    Member
    Posted 6 months ago #

    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/

  2. jeffparker
    Member
    Plugin Author

    Posted 6 months ago #

    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;}
  3. paravia
    Member
    Posted 6 months ago #

    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??

  4. jeffparker
    Member
    Plugin Author

    Posted 6 months ago #

    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;}
  5. paravia
    Member
    Posted 6 months ago #

    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!

  6. jeffparker
    Member
    Plugin Author

    Posted 6 months ago #

    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.

  7. paravia
    Member
    Posted 6 months ago #

    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!

  8. paravia
    Member
    Posted 6 months ago #

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

  9. jeffparker
    Member
    Plugin Author

    Posted 6 months ago #

    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.

  10. paravia
    Member
    Posted 6 months ago #

    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!!

  11. jeffparker
    Member
    Plugin Author

    Posted 6 months ago #

    Glad to hear!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags