Files to accompany my WordPress Melbourne meetup talk (Nov 2012) on WordPress Queries
At the WordPress Melbourne meetup (http://www.wpmelb.org/) in November 2012, I'll be presenting "WordPress Queries - The Right Way". I'll be discussing the right way to change your templates main query, using the pre_get_posts hook, rather than creating a secondary query using query_posts() or even WP_Query().
These files are changes (& additions) that I made to the standard Twenty Twelve theme so as to provide a quick demonstration.
The code contains the pre_get_posts hook along with a sample Custom Post Type to show how easy it is to use with CPT's as well as "std" WordPress queries.
- Add code within
functions.phpfile in the standard WordPress Twenty Twelve theme. The twentytwelve_entry_meta() function simply replaces the original version. The remaining code is new and can simply be appended to the end of the
content-movie.phpto the root Twenty Twelve folder
- Activate Twenty Twelve theme