iSimone
Member
Posted 3 years ago #
I added a query_posts string to get the recent 5 posts by tag onto a post (with a exec php plugin).
It works great, just that it breaks the wp-ratings and the comment form in that post. Why is that, can anyone help?
<div class="newspagetop">
<?php
$postslist = query_posts('posts_per_page=5&orderby=date&tag=one-condoms');
(...)
<?php endforeach; ?>
</div>
iSimone
Member
Posted 3 years ago #
Any query_posts cracks out there help?
iSimone
Member
Posted 3 years ago #
Use get_posts and a foreach loop. Query_posts will mess up your Loop.
iSimone
Member
Posted 3 years ago #
Yes, true, but with get posts I've got the problem that it does not display the right title and picture, instead it only displays the title&permalink and picture of the page the code is in?
What am I doing wrong?
Use setup_postdata with that:
foreach($postslist as $post) {
setup_postdata($post);
.
.