WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Yet Another Related Posts Plugin] Recent post only show in full post view (15 posts)

  1. staypuff
    Member
    Posted 5 years ago #

    I've added the plug-in, which is really fantastic, however the related posts only appear when you click on the link for each post. They do not appear on my blog with a number of the posts shown. Most of my posts do not include the <--!more-->, so I'd have thought they'd show on the main page too.

    Is there an option for this that I have missed? Any help would be greatly appreciated.

    David
    staypuff.net

  2. @staypuff - You are correct--YARPP only has automatic display options for the single post display pages and RSS.

    If you'd like to add the display manually to your index and archive pages, you can simply add the line <?php related_posts(); ?> to your template's archive.php or index.php right below the line with the_content() or the_excerpt(). (The specifics of where this would go depend on your theme.)

  3. staypuff
    Member
    Posted 5 years ago #

    That worked beautifully.

    Thanks for the help and again, well done on an excellent plug-in.

  4. bitmover
    Member
    Posted 5 years ago #

    I tried putting <?php related_posts(); ?> into my index.php but nothing shows up, it works fine on my single pages. I'm using YARPP 3.0b7

    http://www.twigandthistle.com/blog

    Love YARPP!
    Thanks in advance!

  5. @bitmover are you placing that PHP in The Loop, as in, right after the content?

  6. bitmover
    Member
    Posted 5 years ago #

    Hi Mitcho!

    Here is where I put it in index.php:

    <div class="postbody">
    			<p class="post"><?php the_content('<br /><b>Continue reading... </b>'); ?></p></div>
    <?php related_posts(); ?>
    </div>
    
    				<p class="tags"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?></p>
    			<br />
    
    			<p class="postmetadata alt"></p>

    I also tried:
    <p class="post"><?php the_content('<br /><b>Continue reading... </b>'); ?></p><?php related_posts(); ?></div>
    but that didn't work either.

    Thanks!

  7. Hmm... that is odd indeed. There is nothing in the related_posts() code that should limit it to single post displays.

    Is there any error being produced?

  8. bitmover
    Member
    Posted 5 years ago #

    Is there any error being produced?

    None that I can see, I also tried disabling all plugins beside yarpp and yapb and switching to the default yarpp setting but nothing worked.

  9. Hmm... this is quite odd...

    If you ask your web hosting provider you probably can see the PHP error log (error.log). If there are any lines in there which are coming from a file in the yet-another-related-posts-plugin directory, I'd love to know what they are. Thanks!

  10. bitmover
    Member
    Posted 5 years ago #

    I managed to get ahold of my error log but I don't really see anything. You can take a look if you like:

    http://twigandthistle.com/error_log

    Also I upgrade to the latest version of YAARP and still nothing. Is there anything else YARRP need to display on the main page?

  11. Hmm... odd. The place you put it in your theme code looks right, so I'm not sure what's going on. :(

  12. bitmover
    Member
    Posted 5 years ago #

    Okay I'm an idiot, I was editing the wrong theme! It works now, sorry for wasting your time Mitcho!

  13. Glad you got it worked out! :)

  14. reetzk
    Member
    Posted 5 years ago #

    I tried this quote and I managed to get the plugin to work on my multi-posts pages...but now I have 2 results showing up on my single posts pages...What do I do??

  15. reetzk, you most likely haven't turned off the "automatic display" option in YARPP options, so you're getting the manual copy and the automatic copy both.

Topic Closed

This topic has been closed to new replies.

About this Topic