Skip to content

Instantly share code, notes, and snippets.

@furahaclothing
Created February 10, 2013 10:10
Show Gist options
  • Save furahaclothing/4749064 to your computer and use it in GitHub Desktop.
Save furahaclothing/4749064 to your computer and use it in GitHub Desktop.
wordpressでタグ別記事一覧の方法(&see allでタグ別のアーカーブに飛ばす)
<ul>
<?php
$tags = array(id,id,id);
for ($i=0; $i<count($tags); $i++) :
?>
<strong><?php $tag_term = get_term( $tags[$i], 'post_tag' );echo $tag_term->name; ?>
</strong>
<span><a href="<?php echo get_term_link( $tags[$i], 'post_tag' ); ?>"><?php _e('see all', 'usces'); ?> &raquo;</a></span>
<ul>
<?php
query_posts('showposts=&tag_id='.$tags[$i]);
if (have_posts()) : while (have_posts()) : the_post();
?>
<div class="thumbnail_box">
<div class="thumimg"><a href="<?php the_permalink() ?>"><?php usces_the_itemImage($number = 0, $width = 150, $height = 150 ); ?></a></div>
<div class="thumtitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php usces_the_itemName(); ?></a></div>
<?php if (usces_is_skus()) : ?>
<div class="price"><?php usces_crform( usces_the_firstPrice('return'), true, false ); ?></div>
<?php endif; ?>
</div>
<?php endwhile; ?>
</ul>
<?php else: ?>
<li><?php $tag_term = get_term( $tags[$i], 'post_tag' );echo $tag_term->name; ?></li>
</ul>
<?php endif; ?>
<?php wp_reset_query(); ?>
<?php endfor; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment