I am trying to edit the Nivo-Slider on my wordpress blog - it currently displays the image caption. I would like it to display the post title, here is the code for the slider:
<div id="slider">
<?php
$n_slices = get_option('wpns_slices');
?>
<?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' ); if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<?php if(has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail(); ?> <!--Want to display Post Title here-->
</a>
<?php endif ?>
<?php endwhile; endif;?&g开发者_如何学Got;
<?php wp_reset_query();?>
</div>
Just use <?php the_title(); ?>
again:
<div id="slider">
<?php
$n_slices = get_option('wpns_slices');
?>
<?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' ); if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<?php if(has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail(); ?> <?php the_title(); ?>
</a>
<?php endif ?>
<?php endwhile; endif;?>
<?php wp_reset_query();?>
</div>
精彩评论