Grow your CSS skills. Land your dream job.

PHP is pulling my post in twice

  • # June 23, 2012 at 7:59 pm

    I have this code that is doing what it should nicely on the right sidebar, pulling two post excerpts. Unfortunately for some reason it is also pulling two FULL post into my page! You will see them under the note thing. Why?
    Thanks!

    http://homerunlogo.com/test/


      < ?php query_posts('showposts=6'); ?>
      < ?php while (have_posts()) : the_post(); ?>
    • ">< ?php the_title(); ?>

    • < ?php the_excerpt(__('(more…)')); ?>

    • < ?php endwhile;?>
    # June 23, 2012 at 8:10 pm

    The code you posted, seems correct…so the full posts showing on the page, probably come from some other code on that page. Look in your template for another query somewhere.

    # June 23, 2012 at 8:57 pm

    try using the wp_reset_query(); after the endwhile

    http://codex.wordpress.org/Function_Reference/wp_reset_query

    # June 24, 2012 at 6:01 pm

    Thanks that got it.

    # June 24, 2012 at 8:45 pm

    Your welcome

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".