开发者

Add post title to Nivo-Slider for wordpress

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜