Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I read the thread about adding a filter on the last line of the code, but am not sure that will work here.

http://www.ahy4life.com/resources.php

In the middle right column in the Promotions section, the 'Continue reading ->' link is linked to the wrong page.

How can I correct this?

<div id="globalcontent">
  <?php
  $featuredPosts = new WP_Query();
  $featuredPosts->query('showposts=5&cat=8');
  while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
    <h2 style="color:#FFFFFF; background:url(http://ahy4life.com/images/right_top_header.jpg) no-repeat left top;"><center><?php the_title(); ?></center></h2>
    <div>
      <style type="text/css">
      div a{
       color:#FFFFFF;
      }
      </style>

      <?php the_excerpt(); ?>

      <?php endwhile; ?>
    </div>
  </div>
<div><img src="images/right_top_footer.jpg" alt="" /></div>
<div style="background-color: #FFF;"></div> 

TIA

share|improve this question
    
If you mean "middle of the right column on the Promotions page", that section is talking about events and the link is to the events page. What is the problem? –  s_ha_dum Dec 12 '12 at 15:52
    
@user24732 Both box's ("events" and "promotion") continue reading link pointing to same events.php. Is it what you are trying to fix? –  M-R Dec 12 '12 at 16:01
add comment

1 Answer

Use "wp_reset_postdata();" right after "endwhile;" seems like your second query fetching link from your previous query.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.