I have a custom post type 'events', to which I have associated a custom taxonomy 'calendar'. The calendar has 12 fixed terms, for each month of the year ( 'august', 'october', 'november, etc.).
I'm in the process to make the archive page for the 'events' post type. I was thinking to display 12 different lists of max 10 posts each, for each month of the year == terms in the 'calendar' taxonomy.
Since this would be an archive page, Wordpress would have already queried the database for 'events' post type. I was about to use query_posts
to alter the main query, but I suddenly wondered if there was a better way to make a more optimized use of the default query. query_posts
would essentially throw away the main query and with 12 lists to generate, it would cause more hits to the database.
Which is the best practice for this case?
Would you just run 12 instances of query_posts, one for each list, or you'd rather do something else, ie with pre_get_post
s or something?
thanks for sharing your ideas