[theme-reviewers] Proper use of pre_get_posts callback
priyanshu.mittal at gmail.com
Thu Oct 2 19:09:27 UTC 2014
There you go https://themes.trac.wordpress.org/ticket/20284
On Thu, Oct 2, 2014 at 2:49 AM, Konstantin Kovshenin <kovshenin at gmail.com>
> In that case new WP_Query() is just as "incorrect" as query_posts().
> Both are used for secondary loops, the former is just a bit more sane
> than the latter, but under the hood they're pretty much the exact same
> If the developer needs to alter the main loop, they should be using
> the pre_get_posts action, not overwriting the query with something
> else. It would also help if you provided a link to the ticket.
> On Tue, Sep 30, 2014 at 12:12 PM, priyanshu mittal
> <priyanshu.mittal at gmail.com> wrote:
> > I am reviewing a theme.
> > In this theme developer used a slider and masonary layout from the
> > file.
> > He used sticky posts to make up the slider:- for this the seperate
> > object is called and properly resetted via wp_reset_postdata function.
> > In the masonry layout of posts in order to use his own custom pagination
> > function, he used query_posts, to alter the core loop, I know this is not
> > the correct way to do it.
> > My point is should I ask him to create new wp_query object for this or
> > should I advice him to use pre_get_posts function.
> > Thanks
> > _______________________________________________
> > theme-reviewers mailing list
> > theme-reviewers at lists.wordpress.org
> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the theme-reviewers