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'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">

<?php 
$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 -->
    </a>
    </li>
       <?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 -->
</div> 

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
add comment

1 Answer

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
1  
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
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.