WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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'm attempting to use jQuery cycle to create a rotator on my blog (which will be used going forward on all other blogs) like the following: http://www.pbs.org/teachers

<div id="feature-well">

$loop = new WP_Query( array( 'category_name' => 'Dynamic Lead', 'posts_per_page' => 3 ) ); 
$i = 0; ?>

<ul id="feature-well-features">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>       
    <li class="feature-well-feature <?php echo ++$i; ?>">
    <a href="<?php echo get_post_meta($post->ID, 'custom_permalink', true); ?>">
        <img alt="<?php the_title(); ?> image" <?php echo get_post_meta($post->ID, 'img_url', true); ?" />
        <span class="feature-description">
            <span class="feature-go">Go!</span>
            <span class="feature-title"><?php the_title(); ?></span>
            <span class="feature-summary"><?php the_content(); ?></span>
        </span><!-- feature-well-description -->
       <?php endwhile; ?>             
</ul><!-- feature-description -->
<?php $i = 0; ?>
<ul id="feature-nav">

    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    <li class="feature-<?php echo ++$i; ?> <?php if ( $i <= 1 ) echo 'activeSlide'; ?>"><a href="<?php echo get_post_meta($post->ID, 'custom_permalink', true); ?>" <?php if ( $i <= 1 ) echo 'class="activeSlide"'; ?>><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul><!-- feature-list -->

But when I implement the above code, I get nothing but blank space (the page doesn't continue loading). I've tried several tutorials about creating jQuery sliders in WP but none that allow me to have captions along with, lack of better word, buttons that hold the same titles as the captions.

Can anyone help me out?

share|improve this question
up vote 1 down vote accepted

First: You should use an IDE like "Eclipse" or "PhpFireStorm".

Second: Re-reading your code is always a good advice - what's missing in the next line?

<img alt="<?php the_title(); ?> image" <?php echo get_post_meta($post->ID, 'img_url', true); ?" />

Third: You need to state global $post; at the beginning of your file, before you can access the provided data from the global post object.

Fourth: Never ever do something like this: <?php echo 'bla'; ?><?php echo 'whatever'; ?>. It doesn't harm, but it's aweful to read (and you should def. avoid it if you're making money with code/webdesign).

share|improve this answer
Thanks for the tips kaiser. I looked and looked at the code for two days and totally missed my img src error. – Justice Is Cheap Aug 17 '11 at 15:52
@Justice Is Cheap n/p. You're welcome. – kaiser Aug 17 '11 at 15:53

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.