フォーラムへの返信

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • フォーラム: 使い方全般
    返信が含まれるトピック: 固定ページで、記事の属するカテゴリ名の表示
    トピック投稿者 Ycchi87

    (@ycchi87)

    すみません、後者の「抽出した商品毎(have_post()の出力結果)にカテゴリ名を抽出」です。
    商品が服なので、その商品が属するカテゴリを項目の一つとして出力したいのです。
    可能でしょうか?具体的なソースも教えて頂けると助かります。。

    <div id="collectionWrap" class="clearfix">
    <?php $loop = new WP_Query( array( 'post_type' => 'collection', 'posts_per_page' => 8 ) ); while ( $loop->have_posts() ) : $loop->the_post(); ?>
    	<div class="collection">
    		<div class="image"><a href="<?php the_permalink() ?>"><?php echo wp_get_attachment_image(get_post_meta($post->ID,"画像",true),'medium' ); ?></a></div>
    		<div class="txt">
    			<div class="clearfix mb10">
    				<p class="upDate"><?php echo get_post_meta($post->ID,"性別",true); ?></p>
    				<p class="seasons">
    
    				<span>
    				/*ここにカテゴリを出力 */
    				</span></p>
    			</div>
    			<p class="itemName"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
    			<p class="itemPrice">&yen;&nbsp;<?php echo get_post_meta($post->ID,"価格",true); ?></p>
    		</div>
    	</div>
    	<?php endwhile; ?>
    <?php wp_reset_query(); ?>
    
    </div>
    </div>
    </div>
    <?php get_footer(); ?>
1件の返信を表示中 - 1 - 1件目 (全1件中)