Yet Another Related Posts Plugin (YARPP)
Bypass some of the default settings one choses in the admin panel with templates (1 post)

  1. Andrés Sanhueza
    Posted 2 years ago #

    Example of one of the default template code one of the widget uses:

    <?php if (have_posts()):?>
      <ul class="related-post-loop">
      <?php while (have_posts()) : the_post(); ?>
      <?php if (has_post_thumbnail()):?>
      <li><figure><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('post-main-thumb'); ?><figcaption><?php the_title(); ?></figcaption></figure></a>
      <?php endif; ?>
      <?php endwhile; ?>
    <?php else: ?>
      <?php endif; ?>

    I modified it a bit to have a more custom looking widget, including filtering by post type. One thing I can't get, however, is to have it showing a different number of posts than the one specified on the settings, among other things. I believe one uses WP_Query for that, but it don't seems to work here.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yet Another Related Posts Plugin (YARPP)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Andrés Sanhueza
  • This topic is not resolved
  • WordPress version: 3.8