-
Book Overview & Buying
-
Table Of Contents
Professional WordPress - Third Edition
By :
The opening discussion of Loop flow of control mentioned that the main workhorse for data selection is the get_posts() method of the WP_Query object. In most cases, if you want to build a custom Loop, you’ll build your own WP_Query object and reference it explicitly. Alternatively, you can use the lower-level query_posts() and get_posts() functions (not to be confused with the methods within the WP_Query object of the same name) to manipulate the output of the default query that was passed into your Loop. Both query_posts() and get_posts() use the WP_Query class to retrieve content. The final method you’ll examine is the pre_get_posts hook. This hook is called after the query variable object is created but before the actual query is run. You’ll look at the various approaches and discuss how and where you should—and shouldn’t—use them, but let’s start with a discussion of how you build a custom query object.
Change the font size
Change margin width
Change background colour