WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] Don't show related posts on sticky? (3 posts)

  1. CarolWP
    Member
    Posted 1 year ago #

    Is there a way to keep related links from displaying on a sticky post? I've got a general "Welcome to my site" type of post as a sticky, and the concept of relatedness doesn't really apply to it.

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

  2. CarolWP
    Member
    Posted 1 year ago #

    Just answered my own question! I switched to using a new template to show the related posts. I edited the example template to read as follows, and called it yarpp-template-new.php:

    <?php
    /*
    YARPP Template: New
    Author: Me, based on mitcho (Michael Yoshitaka Erlewine)
    Description: My YARPP template.
    */
    ?>
    
    <?php if ( ( !is_sticky() ) && (have_posts())):?>
    
    <h3>Related Posts</h3>
    <ol>
    	<?php while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><!-- (<?php the_score(); ?>)--></li>
    	<?php endwhile; ?>
    </ol><br><br>
    
    <?php endif; ?>
  3. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Great! That's a nice systematic solution.

    You can also add the comment <!--noyarpp--> to any post to display the automatic display of YARPP on that page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic