WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts
[resolved] Related Posts Not Showing in Posts (8 posts)

  1. jteipen
    Member
    Posted 5 months ago #

    Related posts appear just fine when viewing individual posts from within my WP dashboard. However, they don't appear in those same posts when I access the website from either from the WP dashboard or externally by way of the URL.

    My website is:
    http://www.guitarchase.com

    Any help you can provided would be appreciated.

    Thanks
    Jim

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

  2. Mateja
    Member
    Plugin Author

    Posted 5 months ago #

    Hey Jim,
    I think there's nothing nothing to worry about... yet :)

    Our plugin has two types of related posts:
    (1) posts you see below the editor (within your WP dashboard) are related posts from other bloggers in our network and you have to click on them to insert them in a post and
    (2) related posts from your own blog that are automatically added to your posts, but are displayed only when you click on single post

    Now... I can see related posts from (2) when I click on individual post, so plugin is working. If you would like to see your related posts shown on index page too, you'll have to add a line of code in our index template file.
    If you like, you can also insert some related articles from other bloggers writing about similar topic...

    Hope this helps. If you have any other question or something, I'll gladly help :)

    Take care & have a nice day,
    Mateja

  3. jteipen
    Member
    Posted 5 months ago #

    Mateja,

    The type of related posts that I was referring is number 2 from your response, which are related posts from my own blog.

    They do appear if I click on individual posts as you said, however, I'd prefer that they also show embedded within the individual posts on the index page, that is without having to click the post.

    You mentioned adding a line code to your index template file. Can you tell me the code to add?

    Thanks very much for your help,
    Jim

  4. Mateja
    Member
    Plugin Author

    Posted 5 months ago #

    Let's do some template hacking then :)

    You'll have to edit index.php file in your current template folder and add some custom CSS rules in Related Posts plugin's settings.

    First, find the following line of code in the index.php:
    get_template_part( 'content', get_post_format() );

    and add this line just below it:
    wp_related_posts();

    You should end up with something like this:

    <?php
    	if ( have_posts() ) :
    		// Start the Loop.
    		while ( have_posts() ) : the_post();
    
    			/*
    			 * Include the post format-specific template for the content. If you want to
    			 * use 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() );
    			wp_related_posts();
    
    		endwhile;
    		// Previous/next post navigation.
    		twentyfourteen_paging_nav();
    
    	else :
    		// If no content, include the "No posts found" template.
    		get_template_part( 'content', 'none' );
    
    	endif;
    ?>

    Second, go to Related Posts plugin's settings page, expand Customize in the Desktop/Tablet theme settings and copy/paste following CSS rules in the textarea with (pre-set) custom CSS... Later you'll probably have to tweak CSS rules some more (depending on your theme), but first things first...

    This custom CSS will center related posts sections and left-align sections' titles:

    .wp_rp_wrap {
    text-align:center;
    }
    .related_post_title {
    text-align:left;
    }
    ul.related_post {
    }
    ul.related_post li {
    }
    ul.related_post li a {
    }
    ul.related_post li img {
    }

    Let me know if you need any further assistance and/or final CSS tweaking.

    Best,
    Mateja

  5. esmi
    Forum Moderator
    Posted 5 months ago #

    Let's do some template hacking then

    Let's not but use a child theme instead...

  6. Mateja
    Member
    Plugin Author

    Posted 5 months ago #

    @esmi, yes, thank you for bringing this up :)

    Jim,
    please read How to Create a Child Theme first and create a child theme for your current theme.
    This way you'll be able to automatically update your theme without losing related posts every time you do this.

    After creating your child theme, just copy index.php to your child theme and follow the steps described in my previous response.

    If you need help with any of these - just let me know.

  7. Mateja
    Member
    Plugin Author

    Posted 5 months ago #

    Hey Jim,

    did you manage to get related posts up and running, so I can close this topic?
    Let me know if you need help.

    Best,
    Mateja

  8. PetraP
    Member
    Plugin Author

    Posted 2 months ago #

    Hey,

    hope you don't mind, we'll mark this topic as resolved as there was no response from original author for more than a month.

    If you find yourself with any other questions or if there's anything that's not completely clear, do let us know!

    Best,
    Petra

Reply

You must log in to post.

About this Plugin

About this Topic