WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts
[resolved] Exclude categories from results but don't exclude widget (3 posts)

  1. tami73
    Member
    Posted 1 year ago #

    Hi, love your plugin, it does exactly what it says and it looks great too!

    I have a couple of questions.

    1. I have used the 'exclude these categories' setting to filter out the categories that I don't want showing up in the results. The only thing is, I actually want related posts to show up while a user is in a post in that category. For instance, I repost our newsletters in our blog but I don't want them showing up in the widget results but I want the users to be able to see related posts anyway from other categories). Can this be done?
    2. Is there a way of displaying related posts in the archive pages too?

    http://wordpress.org/extend/plugins/related-posts/

  2. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    Hey Tami, sorry for the late reply!

    1. I'm afraid this is not possible. The exclusion works both ways — the related posts don't show up in those excluded categories and those posts from the excluded category don't get recommended elsewhere on your blog as well. I'm really sorry about that!

    2. Yes, there is, but it depends on what WP theme you are using. The main thing is, you'll have to enter the following code in the right place:

    <?php wp_related_posts()?>

    If you are using the TwentyTwelve or TwentyEleven theme, go to the tab 'Appearance'-'Editor' (in your WP Dashboard), click on the archive.php file, and enter that code after the following lines:

    /* Include the post format-specific template for the content. If you want to
    				 * this in a child theme then include a file called called content-___.php
    				 * (where ___ is the post format) and that will be used instead.
    				 */
    				get_template_part( 'content', get_post_format() );

    So now it should look something like this:

    /* Include the post format-specific template for the content. If you want to
    				 * this in a child theme then include a file called called content-___.php
    				 * (where ___ is the post format) and that will be used instead.
    				 */
    				get_template_part( 'content', get_post_format() );
    				<?php wp_related_posts()?>

    Let me know if this helped you in any way or if you need any additional assistance — I'll gladly help!

    Take care & have a nice weekend!

    Best,
    Silvo

  3. tami73
    Member
    Posted 11 months ago #

    Thanks for your help Silvo. I actually use the genesis theme and I managed to get it showing in the sidebar by using the simple hooks plugin.

    Much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic