Support » Plugin: Yet Another Related Posts Plugin (YARPP) » Don't show related posts on sticky?
4 years 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.
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:
YARPP Template: New
Author: Me, based on mitcho (Michael Yoshitaka Erlewine)
Description: My YARPP template.
<?php if ( ( !is_sticky() ) && (have_posts())):?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><!-- (<?php the_score(); ?>)--></li>
<?php endwhile; ?>
<?php endif; ?>
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.