Customize query (add_filter) with multiple loops
-
Hey guys,
i have more than one Loops in my index.php (posts and featured tabs) and want the main loop to be filtered by extra fields. Both loops are generated via WP_Query and i already have a solution (without plugin). I could simple change the query submitted to the main-WP_Query (&metakey=XXX&metavalue=XXX).
But i’m curious to know how it works with a plugin. I wrote the plugin using following filters “posts_where”, “posts_join” and “posts_groupby” and it works. Unfortunatelly it also applies this changes to the featured-area query.
How can i differentiate between those queries and only apply the changes to the main-loop query?
thxs.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Customize query (add_filter) with multiple loops’ is closed to new replies.