Forums

Query Post Kills Post Rating and Comment Form? (6 posts)

  1. 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>
  2. iSimone
    Member
    Posted 3 years ago #

    Any query_posts cracks out there help?

  3. iSimone
    Member
    Posted 3 years ago #

    One last bump anyone?

  4. na3s
    Member
    Posted 3 years ago #

    Use get_posts and a foreach loop. Query_posts will mess up your Loop.

  5. 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?

  6. MichaelH
    Volunteer
    Posted 3 years ago #

    Use setup_postdata with that:

    foreach($postslist as $post) {
    setup_postdata($post);
    .
    .

Topic Closed

This topic has been closed to new replies.

About this Topic