Problem with query posts
Hi people I am having a little bit of a problem with understanding query posts. In the documentation of query posts in wordpress codex
The query_posts function is intended to be used to modify the main page Loop only. It is not intended as a means to create secondary Loops on the page. If you want to create separate Loops outside of the main one, you should create separate WP_Query objects and use those instead. Use of query_posts on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.
The query_posts function overrides and replaces the main query for the page. To save your sanity, do not use it for any other purpose.
I didn’t understand the part of ‘modifying main page loop only’.So query posts can’t be used in the sidebar or footer to display the recent posts or comments or featured posts ?
- The topic ‘Problem with query posts’ is closed to new replies.