Query debug info

With this wordpress plugin you can view information about the queries used to retrieve the posts in the front end, including page type, post count, query vars, the query string and the wordpress site constants.

Really useful when you are building custom queries and don’t get the desired results displayed on the template and are tired of echoing variables.

You can track up to 3 queries with this plugin.

How to use this plugin

After activating the plugin you can add the function call in your template to display information about the main query:

<?php if (function_exists(‘debuginfo’)) { debuginfo(“Main”); }?>

Add additional calls after creating a new WP_Query object, if you want to track a specific variable you can pass it to the function, example:

<?php $my_query = new WP_Query(“showposts=3&category_name=Featured&order=DESC”); ?>
<?php if (function_exists(‘debuginfo’)) { debuginfo(“Secondary”,2,$my_query); }?>

The information is only displayed if you are logged in as an administrator.

Here are some images of this plugin in action.


Download Query debug info