无法将滑块文本更改为滑块标题

时间:2014-04-21 10:37:20

标签: php jquery css wordpress slider

<ul class="slides">
    <?php 

        $slide = get_option('cany_slide_cat');
        $count = get_option('cany_slide_count');
        $slide_query = new WP_Query( 'category_name='.$slide.'&posts_per_page='.$count.'' );
        while ( $slide_query->have_posts() ) : $slide_query->the_post();
  $do_not_duplicate[] = $post->ID 
    ?>  
    <li>
    <a href="<?php the_permalink() ?>"><img class="slideimg" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo get_image_url()?>&amp;h=300&amp;w=650&amp;zc=1" title="" alt="" /></a>
    <div class="flex-caption">
    <?php wpe_excerpt('wpe_excerptlength_slide', ''); ?>
    </div>
    </li>
    <?php endwhile; ?>
    </ul>

我希望在我的wordpress滑块上有帖子标题而不是帖子文字,但是当我将the_post改为the_title时出错了。

我的网页是:http://soccerway.ge/

提前谢谢

1 个答案:

答案 0 :(得分:0)

你可以通过更新来实现;

<div class="flex-caption">
<?php wpe_excerpt('wpe_excerptlength_slide', ''); ?>
</div>

<div class="flex-caption">
<?php the_title( '<h2>', '</h2>' ); ?>
</div>

这会将当前帖子标题放到每个帖子

相关问题