Nested loop with ‘post__in’
-
This is in the single.php. In the loop I trying to acquire posts that I have stated in the post custom value “tema”. It echos fine, but I don’t acquire any post. Any suggestion? plz help
<?php $recept =get_post_custom_values("tema"); echo $recept[0]; if (isset($recept[0])): $tema=split(',',$recept[0]); $my_query = new WP_Query(array('post__in' =>$tema));?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="singel-entry"> <h2><?php the_title(); ?></h2> <?php edit_post_link('Edit this entry.', '<span>', '</span>'); ?> <?php the_content(); ?></div> <?php endwhile; else : echo "similarpost"; similar_posts(); endif;?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Nested loop with ‘post__in’’ is closed to new replies.