2011-08-30 48 views
0

我想编辑我的WordPress博客上的Nivo-Slider - 它当前显示图片标题。我想它显示文章标题,这里是滑块代码:为wordpress添加Nivo-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;?> 
<?php wp_reset_query();?> 
</div> 

回答

0

就再次使用<?php the_title(); ?>

<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> 
相关问题