• Hi, I need to call query_posts(‘post_type=post&showposts=-1’); but then I need to reset its effects and show the current page…How could I do?

    Thanks
    Federico

Viewing 2 replies - 1 through 2 (of 2 total)
  • Use this function to reset your query:

    <?php wp_reset_query(); ?>
    Thread Starter federicod

    (@federicod)

    Thanks greenshday! Now It works but I have another problem: If a page contains subpages I display them into the sidebar using this code:

    <?php
       if($post->post_parent)
          $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
        else
          $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");

    But It doesn’t work anymore ??

    So I use query_posts(‘post_type=post&showposts=-1’); into the sidebar in order to show posts, then I reset the query into the page and I use the code above in order to show the subpages.

    Any ideas?

    Thanks!!
    Federico

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Call query_posts and then reset the effect’ is closed to new replies.