2012-03-15 5 views
0

以下は、私のスライダーを介したリストアイテムのマークアップのビットです。ポストエディターを使用して、フィーチャーされたイメージのためにimgソースとして含めるべきものは何ですか?そのスライダーの画像として取り込まれます。WPでカスタムスライダーの「Featured Img」を使用する

<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1"><img src="" alt="" style="display:none;"/><span><?php the_title(); ?><br /><p class="info" style="padding-left:10px;"><?php the_excerpt(); ?></p></span></a></li> 

私も、私が持っているimg src <?phpthe_post_thumbnail('slider_image'); ?>

完全なコードのためのPHPのこのビットを挿入しようとしました:で、おそらくより多くの深さで

<div id="content"> 


<?php if (have_posts()) : ?> 

<!--Your slider code goes here--> 


     <div id="featured" > 
     <ul class="ui-tabs-nav"> 

      <?php while (have_posts()) : the_post(); ?> 

      <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1"><img src="" alt="" style="display:none;"/><span><?php the_title(); ?><br /><p class="info" style="padding-left:10px;"><?php the_excerpt(); ?></p></span></a></li> 

      <?php endwhile; ?> 

      <li class="ui-tabs-nav-item" id="nav-fragment-2"><a href="#fragment-2"><img src="" alt="" style="display:none;"/><span><?php the_title(); ?><br /><p class="info" style="padding-left:10px;"><?php the_excerpt(); ?></p></span></a></li> 

      <li class="ui-tabs-nav-item" id="nav-fragment-3"><a href="#fragment-3"><img src="" alt="" style="display:none;"/><span><?php the_title(); ?><br /><p class="info" style="padding-left:10px;"><?php the_excerpt(); ?></p></span></a></li> 

      <li class="ui-tabs-nav-item" id="nav-fragment-4"><a href="#fragment-4"><img src="" alt="" style="display:none;"/><span><?php the_title(); ?><br /><p class="info" style="padding-left:10px;"><?php the_excerpt(); ?></p></span></a></li> 
     </ul> 


     <?php while (have_posts()) : the_post(); ?> 

     <!-- First Content --> 
     <div id="fragment-1" class="ui-tabs-panel" style=""> 
      <img src="<?php the_post_thumbnail('slider_image'); ?>" alt="" /> 
      <div class="info" > 
      <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2> 
      <p><?php the_excerpt(); ?><a href="<?php the_permalink(); ?>" >read more</a></p> 
      </div> 
     </div> 

     <?php endwhile; ?> 

     <!-- Second Content --> 
     <div id="fragment-2" class="ui-tabs-panel ui-tabs-hide" style=""> 
      <img src="<?php the_post_thumbnail('slider_image'); ?>" alt="" /> 
      <div class="info" > 
      <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2> 
      <p><?php the_excerpt(); ?><a href="<?php the_permalink(); ?>" >read more</a></p> 
      </div> 
     </div> 
     <!-- Third Content --> 
     <div id="fragment-3" class="ui-tabs-panel ui-tabs-hide" style=""> 
      <img src="<?php the_post_thumbnail('slider_image'); ?>" alt="" /> 
      <div class="info" > 
      <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2> 
      <p><?php the_excerpt(); ?><a href="<?php the_permalink(); ?>" >read more</a></p> 
      </div> 
     </div> 
     <!-- Fourth Content --> 
     <div id="fragment-4" class="ui-tabs-panel ui-tabs-hide" style=""> 
      <img src="<?php the_post_thumbnail('slider_image'); ?>" alt="" /> 
      <div class="info" > 
      <h2><a href="<?php the_permalink(); ?>" ><?php the_excerpt(); ?></a></h2> 
      <p><?php the_excerpt(); ?><a href="<?php the_permalink(); ?>" >read more</a></p> 
      </div> 
     </div> 
    </div> 

<!--Your slider code goes here--> 
<!-- End Featured Lists Image Slider -->   

<?php endif; ?> 

を:http://www.sitepoint.com/forums/showthread.php?840162-Help-with-Theming-my-jQuery-CSS-slider-in-WP-to-Dashboard!!&p=5084697#post5084697

しかし、そのような運はない、任意の提案?

+0

nada? –

答えて

0

まず、the_post_thumbnailのサイズは 'slider_image'のように定義されていません。異なる解像度に配列(幅、高さ)を使用できる点を除いて、 'フル'、 'ラージ'、 'ミディアム'、および 'サムネイル'を使用できます。

第2に、the_post_thumbnail()関数では取得できない「slider_image」を使用して「カスタムフィールド」を参照していると思います。

投稿に「slider_image」というカスタムフィールドがありますか?もしそうなら、説明された方法を使ってそれらを得ることができますhere

+0

add_image_size( 'slider_image'、940,340、true);サムネイルのサイズが追加されました。 2番目の質問は:あなたの投稿の特集画像が定義されていますか? –

関連する問題