Forums

[Plugin: Yet Another Related Posts Plugin] Templates' incompability with php function calls provided (4 posts)

  1. Iva
    Member
    Posted 2 years ago #

    I spoke to @yarpp on Twitter and I was told to explain my problem further, so here I go.

    I had edited a template provided with the plugin back in May to provide a YouTube-like display of related posts, as they all contain video players with videos and I came up with this. This included Woo themes' custom function for displaying thumbnails and the call to display number of views, from Lester Chan's WP Post-Views plugin.

    <?php /*
    Example template
    Author: mitcho (Michael Yoshitaka Erlewine)
    */
    ?>
    <?php if ($related_query->have_posts()):?>
    <ol>
    	<?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
    	<li>
    	<?php woo_get_image('image','64','64'); ?>
    	<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><br />
    <small><?php if(function_exists('the_views')) { the_views(); } ?></small></li>
    	<?php endwhile; ?>
    </ol>
    <?php else: ?>
    <p>No related posts.</p>
    <?php endif; ?>

    This worked well until the YARPP update yesterday. The related posts are still displayed, but it seems to be ignoring the calls for these two functions. I was wondering how to solve this as I literally did not touch anything.

    Thanks in advance!

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

  2. Are you loading YARPP as a widget, automatically, or manually with related_posts()?

  3. Iva
    Member
    Posted 2 years ago #

    As a widget.

    (Sorry for the late reply, been SUPER-busy).

  4. @SupersonicSquirrel YARPP doesn't use custom templates for widgets... this'll change in the future someday, but in the mean time if you want to use a custom template, you should manually add related_posts() to your theme where you want it, so it displays like a widget.

Topic Closed

This topic has been closed to new replies.

About this Topic