Domanda

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

I want to have post title instead of post text on my wordpress slider, but when im changing the_post to the_title something goes wrong.

My web-page is: http://soccerway.ge/

Thank you in advance

È stato utile?

Soluzione

You can do that by updating;

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

to

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

This will put current post title to each post

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top