Published
March 15, 2013
An in-depth presentation about WP_Query for theme and plugin developers. In-depth Q&A at the end.
Presentation Slides »
Event
WordCamp Netherlands 2012 16
Speakers
Andrew Nacin 34
Tags
Development 362
Plugins 345
Themes 279
Language
English 9822
Download
Subtitles
TTML:
EnglishSubtitle this video →
Producer
March 17, 2018 at 8:34 am |
Thanks so much for this. The slide 17:58 into this presentation fixed a query modification that worked fine on my desktop theme but when used on the Jetpack mobile theme messed up a secondary query/loop I had in a sidebar widget. Still not sure why $wp_the_query === $query should make such a difference, but using the following code did what I wanted to, without breaking the separate loop I had in the sidebar.
global $wp_the_query;
if ( jetpackme_is_mobile() && $wp_the_query === $query && $query->is_home() ) {
$query -> set( ‘cat’, ‘-8’ );
}
Thanks again.
LikeLiked by 1 person