Query Troubleshooter Plugin!
-
I wrote a fabulous little plugin that can help troubleshoot search problems:
ECHO QUERY
It outputs (echoes) the SQL query into an HTML comment tag in the footer, so you can check for problems without your visitors seeing anything different!
Just save the code as a new PHP file, upload it to your site, and activate it.
<?php /* Plugin Name: Echo Query Version: 0.1 Description: Prints the posts query in an html comment */ //No rights reserved. :-) function get_query($query) { //set the database query as a global variable global $query_comment; $query_comment = $query; return $query; } function echo_query() { //print it into the footer global $query_comment; echo "<!-- {$query_comment} -->"; } add_filter('posts_request', 'get_query'); add_action('wp_footer', 'echo_query'); ?>
- The topic ‘Query Troubleshooter Plugin!’ is closed to new replies.