Troubleshoting query_post(), how to get the current or last SQL query performed
-
I have this code in my theme, but for some reason itsn’t displaying nothing:
<?php global $query_string; query_posts($query_string . "posts_per_page=".get_option('onthego_fromblog_random')."&ignore_sticky_posts=1&orderby=rand&cat=".get_catid(get_option('onthego_blog_cat'))); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php get_template_part('includes/fromblog_post'); ?> <?php endwhile; endif; wp_reset_query(); ?>
I’m trying to find where the problem is and for that I enabled at
wp-config.php
:define('WP_DEBUG', true); and define('SAVEQUERIES', true);
and after I install wordpress debug_bar plugin but queries aren’t clear to me, is there another way yo look for a raw SQL just for this piece of code or any other way to troubleshooting this issue? Or I have something wrong in my code and I don’t see it?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Troubleshoting query_post(), how to get the current or last SQL query performed’ is closed to new replies.