The document discusses using template tags and custom queries in WordPress themes. It introduces common template tags like THE_CONTENT(), THE_TITLE(), and THE_DATE() and explains the difference between using QUERY_POSTS to modify the main loop versus using GET_POSTS() to create secondary loops. It also provides an example of how to use QUERY_POSTS to query posts from a specific category or custom post type.
10. QUERY_POSTS
WHEN YOU WANT TO CHANGE THE MAIN LOOP
EXCLUDE CATEGORIES FROM MAIN LOOP
SHOW POSTS FROM ONLY ONE CATEGORY.
11. IMPORTANT NOTE
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 USE
GET_POSTS() 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.