[wp-trac] [WordPress Trac] #28382: WP_Query - Main Query Flag
WordPress Trac
noreply at wordpress.org
Wed May 28 18:59:26 UTC 2014
#28382: WP_Query - Main Query Flag
-------------------------+-----------------------
Reporter: Howdy_McGee | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Query | Version: 3.9.1
Severity: normal | Resolution: invalid
Keywords: | Focuses: template
-------------------------+-----------------------
Comment (by ericlewis):
Replying to [comment:4 Howdy_McGee]:
> query_posts() is there to replace the main query, but if it's slow(er
than WP Query) to use and widely discouraged, why is it the only option to
replace the main query? Why are there no alternatives?
As @SergeyBiryukov mentioned,
[http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
pre_get_posts] is the best way to modify/replace the main query. Have a
read, play around with it, and if that doesn't fit your situation, explain
in detail your use case and why pre_get_posts doesn't work for it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28382#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list