Skip to content

Instantly share code, notes, and snippets.

@furahaclothing
furahaclothing / gist:3313127
Created August 10, 2012 09:59
ドロップダウンメニュー
/*html*/
<ul id="nav2" class="clearfloat">
<li><a href="<?php echo get_option('home'); ?>/" class="on">Home</a></li>
<?php wp_list_categories('orderby=name&exlude=181&title_li=');
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<ul>";
wp_list_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "</ul>";
}
@furahaclothing
furahaclothing / gist:3423039
Created August 22, 2012 06:40
thumnail loop
<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 ); ?><?php usces_guid_tax(); ?></div>
<?php endif; ?>
</div><!– thumbnail_box –>
@furahaclothing
furahaclothing / gist:3423107
Created August 22, 2012 06:53
welcart-お勧め商品の表示-
<?php $reco_ob = new wp_query(‘showpost=●&cat=●’); ?>
<?php if ($reco_ob->have_posts()) : while ($reco_ob->have_posts()) : $reco_ob->the_post(); usces_the_item(); ?>
<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()) : ?>
<?php endif; ?>
</div>
@furahaclothing
furahaclothing / gist:3423117
Created August 22, 2012 06:57
welcart-2つ目のループ表示-
<p><?php echo category_description(item); ?></p>
<?php query_posts(‘cat=●●&showposts=●●’); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); usces_the_item(); ?>
<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>
</div>
<?php endwhile; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
@furahaclothing
furahaclothing / gist:3423170
Created August 22, 2012 07:04
wordpress-カスタム投稿ループの表示-
<div class="title"><?php _e('Blog Article','usces') ?></div>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$newloop = new WP_Query(array(
'post_type' => blog,
'posts_per_page' => 4,
'paged' => $paged
));
if ($newloop->have_posts()) :
while ($newloop->have_posts()) : $newloop->the_post();
@furahaclothing
furahaclothing / gist:3712842
Created September 13, 2012 08:21
wordpress-カスタム投稿の関連記事を出力-
<?php
$loop = new WP_Query( array( 'post_type' => 'blog', 'posts_per_page' => 4, 'orderby' =>rand ) );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="thumbnail_box3">
<li><a href="<?php the_permalink() ?>"><?php the_post_thumbnail(array(150,150)); ?> </a></li>
<div class="thumtitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__(' %s', 'uscestheme'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></div></div>
<?php endwhile;wp_reset_query(); ?>
@furahaclothing
furahaclothing / gist:3712851
Created September 13, 2012 08:25
wordpress-カスタム分類の記事に使われたタグの出力-
<?php echo get_the_term_list( $post->ID, 'blog-tag', 'TAG: ', ' , ', '' ); ?>
@furahaclothing
furahaclothing / gist:3712861
Created September 13, 2012 08:28
wordpress-カスタム分類の記事毎のカテゴリー出力-
<?php
$taxo_list = get_the_term_list( $post->ID, 'blog-cat', '<strong>categotry:</strong> ', ', ', '' );
if ( $taxo_list ):
@furahaclothing
furahaclothing / gist:3712942
Created September 13, 2012 08:42
wordpress-カスタム投稿の最新記事5件を出力したい-
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$newloop = new WP_Query(array(
'post_type' => blog,
'posts_per_page' => 5,
'paged' => $paged
));
if ($newloop->have_posts()) :
while ($newloop->have_posts()) : $newloop->the_post();
?>
@furahaclothing
furahaclothing / gist:3712957
Created September 13, 2012 08:44
wordpress-カスタム分類のタグ一覧リスト表示-
<ul>
<?php wp_list_categories('taxonomy=blog-tag&title_li='); ?>
</ul>