[Plugin: Yet Another Related Posts Plugin] Problem with template system
-
Hi, recently I update to the lastest version of YARPP but I cant make work the template system.
I created my own template but when I call it in single.php it doesn’t display. I see the native template of YARPP.
These are the codes I am using:
Template (called yarpp-template-avenue.php and placed in my theme folder):
<?php /* Entradas relacionadas Author: mitcho (Michael Yoshitaka Erlewine) */ ?> <?php if (have_posts()):?> <?php while (have_posts()) : the_post(); ?> <div class="related-item"> <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'related-thumb'); ?> <a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='134' height='90' /></a> <h4><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><?php the_title(); ?></a></h4> </div> <?php endwhile; ?> <?php else: ?> <p>No hay artículos relacionados.</p> <?php endif; ?>
Function in single.php:
`<?php yarpp_related(array(
‘past_only’ => false, // show only posts which were published before the reference post
‘exclude’ => array(), // a list of term_taxonomy_ids. entities with any of these terms will be excluded from consideration.
‘recent’ => false, // to limit to entries published recently, set to something like ’15 day’, ’20 week’, or ’12 month’.
‘weight’ => array(
‘title’ => 2,
‘tax’ => array(
‘post_tag’ => 4,
‘category’ => 1,
)
),
‘require_tax’ => array(
‘post_tag’ => 1
),
‘threshold’ => 5,
‘limit’ => 8,
‘order’ => ‘score DESC’,
‘template’ => yarpp-template-avenue.php // either the name of a file in your active theme or the boolean false to use the builtin template),
$reference_ID,true); ?>`
Any idea?
Thanks! Great plugin!
- The topic ‘[Plugin: Yet Another Related Posts Plugin] Problem with template system’ is closed to new replies.