WordPress.org

Ready to get started?Download WordPress

Forums

Custom WP_Query and Search Everything (1 post)

  1. Paracetamol
    Member
    Posted 6 years ago #

    Hello! I've always been a happy user of Search Everything, but now I encountered a strange problem using a custom query aside the usual loop:
    On my sidebar rests a small list of the category "announcements". The number of articles in this category is often changing, sometimes displaying not more than one or two.

    By using Search Everything, it's filling up the post count in the custom loop with the search results of the regular loop (on the search pages). Is there a way to bypass this?

    Example of the code in use:

    <?php $new_query = new WP_Query("category_name=announcements&showposts=7"); while($new_query->have_posts()) : $new_query->the_post();?>
    
    <!-- output of title and permalink -->    
    
    <?php endwhile;?>

    I guess it could have to do something with the filter rules, but I'm not smart enough to sort this out. In the worst case, I could just exclude this portion on the search page.

Topic Closed

This topic has been closed to new replies.

About this Topic