Multiple Loops – First loop constrained by second loop
-
I have two loops: one in the Header and the standard main one.
The one in the Header is supposed to retrieve records that match 2 categories for the whole current year. What is happening is that the first loop is only returning records in the matched categories from the 8 records returned by the main loop (main loop set to return only last 8 records).
Header loop:
http://wordpress.pastebin.ca/1834779
The main loop is unchanged.
I thought that $my_query = new WP_Query would retrieve all records that match cat_1 and cat_2 for the whole year. Instead it returns only for those in the 8 records returned by the main loop. So if the main loop does not contain any records with those 2 categories, the Header loop displays nothing (even if there are lots for this year).
Thanks for any help.
The topic ‘Multiple Loops – First loop constrained by second loop’ is closed to new replies.