Skip to content

Instantly share code, notes, and snippets.

@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: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:3712957
Created September 13, 2012 08:44
wordpress-カスタム分類のタグ一覧リスト表示-
<ul>
<?php wp_list_categories('taxonomy=blog-tag&title_li='); ?>
</ul>
@furahaclothing
furahaclothing / gist:3713027
Created September 13, 2012 08:55
wordpress-サイドバーで異なるウィジェットを使う-
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(8) ) : ?>
<?php endif; ?>
@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:3712995
Created September 13, 2012 08:51
wordpress-サイドバー毎に異なるウィジェットを使う-
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar( array(8,
'name' => __( 'Secondary Widget Area', 'テンプレート名' ),
'description' => __( 'The secondary widget area', 'テンプレート名' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
@furahaclothing
furahaclothing / gist:3898157
Created October 16, 2012 08:58
wordpress-説明の箇所にhtmlを使えるようにする-
<? php remove_filter( 'pre_term_description', 'wp_filter_kses' ); ?>
@furahaclothing
furahaclothing / awakward showcase
Created December 22, 2012 14:31
jQuery:awkward showcase
<div id="showcase" class="showcase" style="width: 800px; ">
<div class="showcase-slide">
<div class="showcase-content">
<div class="showcase-content-wrapper">
<img src="画像URL>/*画像コンテンツ*/
</div>
</div>
</div>