wordpress
  • nivo-slider
  • 2011-04-26 21 views 0 likes 
    0

    是否有辦法獲得Nivo Slider的當前幻燈片「標題」並將其顯示在另一個div中?獲取Nivo Slider當前幻燈片標題

    <div id="slider"> 
    <?php 
          $category = get_option('wpns_category'); 
         $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(); ?> 
         </a> 
         <?php endif ?>  <?php endwhile; endif;?>  <?php wp_reset_query();?> 
        </div> 
    

    要:在線路209 WP-NIVO-slider.php

    變化

    回答

    1

    開始

    <div id="slider" style="position:relative;"> 
    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(); ?> 
          </a> 
        <div id="slider-title" style="position:absolute; background-image:rgba(0, 0, 0, .5); color:#fff!important; top:10px; left:5px; display:block;"><?php the_title(); ?></div> 
           <?php endif ?> 
         <?php endwhile; endif;?> 
          <?php wp_reset_query();?> 
    </div> 
    

    這將使標題的左上角具有半透明背景的圖像。

    相關問題