Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Change this:

    $blog_query = new WP_Query($blog_args);
    
                                if($blog_query->have_posts()) : while($blog_query->have_posts()) : $blog_query->the_post(); ?>

    to this:

    if(have_posts()) : while(have_posts()) : the_post(); ?>

    and it should work.

    Thread Starter nickschwing

    (@nickschwing)

    Hi Mikko,

    Thanks for the quick reply. Using the changes you suggested above it shows a result, but only ever 1 result, even when there should be many. I’m going to try to debug a little more, but if you have any ideas that would be appreciated!

    Nick

    Plugin Author Mikko Saari

    (@msaari)

    If you add

    global $wp_query; var_dump($wp_query->found_posts);

    before the if (have_posts())... line, what does it print out? If it prints out “1”, your search is set to only return one result. See your blog settings to fix that. If it prints out a larger number, the problem is in your search results template.

    Thread Starter nickschwing

    (@nickschwing)

    Thanks for the thoughts. It looks like the posts_per_page query arg was set to 1 and even if I changed it, it wasn’t updating. Looking into the plugin that might be causing the issue.

    Thanks again.

    Plugin Author Mikko Saari

    (@msaari)

    add_filter('relevanssi_modify_wp_query', 'rlv_set_ppp');
    function rlv_set_ppp($q) {
        $q->set('posts_per_page', 10);
        return $q;
    }

    That should do it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘no results – new WP_Query present’ is closed to new replies.