WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written a query to display in a jquery slider (nivo) however it appears that it is showing all the posts and not just one at a time

This is my code:

<div class="slider-wrapper theme-projects">
    <div id="slider2" class="nivoSlider">
        <?php $the_query = new WP_Query( 'showposts=2' ); ?>
            <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
                <?php the_title(); ?> 
       <?php endwhile;?>

Can anyone advise? The website address is http://www.gordonlundie.com/Howe/


EDIT ok i found a previous post where i was having a same issue yet its still doing the same :S

<div id="recentprojects1">      
     <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('recentprojects1-sidebar') ) :                       endif; ?>
        <div class="slider-wrapper theme-projects">
            <div id="slider2" class="nivoSlider">
                <?php $the_query = new WP_Query( 'showposts=5' ); while ($the_query -> have_posts()) : $the_query -> the_post();?>

                <h3><?php the_title(); ?></h3>
                <?php the_content(); ?>
        <?php endwhile;?>

Guidance on how i have gone wrong, so that i may not make this mistake in the future is greatly received rather than unhelpful comments.

share|improve this question
This is really a jQuery related question. – Wyck Sep 17 '13 at 19:39
@wyck why is this? as it is showing the post title of both posts and not just one as i want in the query to show!? – Kirsty Marks Sep 17 '13 at 19:41

It seems you have same images in both post.

share|improve this answer
Please explain how you came to this conclusion and how to correct the issue. – s_ha_dum Sep 17 '13 at 20:06
Below is the code I can see in direbug: <div id="slider" class="nivoSlider"> <img alt="" src="gordonlundie.com/Howe/wp-content/themes/Howe/images/…; style="width: 875px; visibility: hidden; display: inline;"> <img class="nivo-main-image" src="gordonlundie.com/Howe/wp-content/themes/Howe/images/…; style="display: inline; width: 875px; height: 428px;"> <div class="nivo-caption"></div> <div class="nivo-directionNav"></div> </div> – Manish Sep 18 '13 at 6:04

Your Answer


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.