search results page breaks custom loop for posts widget (1 post)

  1. phendyr
    Posted 4 years ago #

    Hey Folks,
    I have a custom loop displaying properly throughout my site, showing 3 posts from a 'press releases page'... the only thing is that if do a search on the site, the search results page breaks the sidebar loop: it will do 1 of 2 things:

    1) display no press releases if the search results do not contain any links to a press release

    2) display only the press release found in the search results.

    here's my code for my sidebar loop:

    <?php $recent = new WP_Query(); ?>
    <?php $recent->query('cat=3&showposts=3'); ?>
    <?php while($recent->have_posts()) : $recent->the_post(); ?>
    <p>" rel="bookmark"><?php the_title(); ?>
    <?php the_time('l, F jS, Y') ?>
    <?php endwhile; ?>

    I've tried adding the reset_query tag to both my search page, and code above... both before & after the call, but nothing works.

    I've tried using plugins for this but they also would spit back some error.... I'd rather know how to code it myself anyway.

    Any suggestions are greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.