[theme-reviewers] Custom Queries

Austin Matzko austin at pressedcode.com
Thu Sep 2 16:10:32 UTC 2010


On Thu, Sep 2, 2010 at 11:04 AM, Chip Bennett <chip at chipbennett.net> wrote:
> If a Theme adds the following in, e.g., the sidebar, does a reset_query()
> need to be called?
>
> $my_query = new WP_Query
>
> Or is a reset not necessary, since the query is called via custom variable?

No, it's not necessary and won't do anything.

wp_reset_query() affects only the global instantiation of WP_Query in
$wp_query.  In this case, since WP_Query has been instantiated in
$my_query, global variable $wp_query doesn't need to be reset.


More information about the theme-reviewers mailing list