Добавить заголовок сообщения в Nivo-Slider для wordpress

Я пытаюсь отредактировать Nivo-Slider в своем блоге WordPress — в настоящее время он отображает заголовок изображения. Я бы хотел, чтобы он отображал заголовок сообщения, вот код слайдера:

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

person Andrew Smart    schedule 30.08.2011    source источник


Ответы (1)


Просто используйте <?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>
person stealthyninja    schedule 30.08.2011