PHP function outside the loop and conditional statement for different post type
-
I′m using the PHP function to call YARPP posts outside of the post loop, also I use single.php for two different post_types. This is ok?
<?php if (is_singular('rezepte')): ?> <?php if(function_exists('related_posts')){ related_posts(array( 'post_type' => array('rezepte'), 'show_pass_post' => true, 'past_only' => false, 'threshold' => 0, 'template' => 'yarpp-template-rezepte.php', 'limit' => 3, 'order' => 'score DESC' ), $post->ID , true); } ?> <?php else: ?> <?php if(function_exists('related_posts')){ related_posts(array( 'post_type' => array('post'), 'show_pass_post' => true, 'past_only' => false, 'threshold' => 0, 'template' => 'yarpp-template-posts.php', 'limit' => 3, 'order' => 'score DESC' ), $post->ID , true); } ?> <?php endif; ?>
The problem is everytime I get the same posts, no matter if I flush cache (yarpp experiments).
Any idea? Thanx.
https://www.ads-software.com/plugins/yet-another-related-posts-plugin/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘PHP function outside the loop and conditional statement for different post type’ is closed to new replies.