WordPress | WP_Query does not return anything with s=a

It’s okay here. My request: SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%a%’) OR (wp_posts.post_content LIKE ‘%a%’))) AND (wp_posts.post_password = ”) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status=”publish”) ORDER BY wp_posts.post_date DESC LIMIT 0, 10 I tried changing the a to other strings and it worked the same – the query … Read more

wp Query Posts to display in Nivo Slider

Take a look at your code now that I have formatted it. You are opening <div class=”slide-caption”> inside the Loop but are not closing it until after the Loop, and you are missing two closing </div> tags altogether (though that may be a copy/paste error). That means the markup is going to be badly broken, … Read more

WP_Query order custom post type with certain meta key value by post modified date

There is an ORDER BY clause in that query that should not have been generated by those arguments. Plus, it doesn’t look like a WordPress query– note the capitalization. WordPress tends to use all uppercase for SQL functions and operators. I suspect that there is a filter on posts_orderby or posts_clauses that is altering that … Read more

How to display WP Query filters?

There’s a global variable called $wp_filter (you can see examples of it all through the source of /wp-includes/plugin.php. This probably isn’t the WordPress Way to do it, but you could try something like this: global $wp_filter; var_dump( $wp_filter ); …but note the caveat on http://codex.wordpress.org/Global_Variables — “Accessing other globals besides the ones listed below is … Read more

Advise on Templates for Custom Queries

I don’t really see anything wrong with what you’re doing; globalizing $post and using setup_postdata() are very standard, well-established techniques for dealing with posts that don’t come straight out of the standard loop; they’re not usually considered hacks.