twentyeleven_content_nav hook no longer outputs navigation link after 3.5 upgrade

This code didn’t change since Twenty Eleven’s initial release. Navigation is only printed if your query has more than one page. Could that be it? Since you are calling $wp_query->have_posts() rather than have_posts(), this suggests you are modifying or overriding the query, which may be confusing WordPress (and it’s not WP’s fault). (See When should … Read more

Gallery shortcode numerical sorting

It doesn’t look like you can do this with the gallery shortcode, unfortunately. The Codex doesn’t even list meta_value_num as an option (though that doesn’t mean it couldn’t work.) However, you’re correct, you must specify a meta-key to use that ordering scheme with WP_Query.

Pre-Populate $wp_query settings with custom rewrite rules and custom template_redirect

I’ve probably found the solution for the above problem. To pre-populate the global variable $wp_query you have to run the query_posts() function with the correct arguments and reset the $wp_query->post with the function wp_reset_postdata(). This must be done on the template_redirect hook or earlier. class Webeo_Download { protected $downloadId; protected $action; public function setup() { … Read more

wordpress ajax relationship query

Look at the very last part of that query– LIKE ‘%\”17497\”%’. You are searching for any characters, followed by literally “17497”, followed by any characters. I am pretty sure that is not what you want. I think you want any characters, followed by 17497 without the quotes, followed by any characters. That means the meta_query … Read more

Replacing raw database query to WP_Query

Finally found the answer. Since I had not specified ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘_recommended’, The limit was being considered as count. I am not sure if am explaining this right