Skip to content

Instantly share code, notes, and snippets.

@furahaclothing
furahaclothing / gist:5625595
Created May 22, 2013 06:12
amazon wishlist button
<a href="javascript:(function(){var w=window,l=w.location,d=w.document,s=d.createElement('script'),e=encodeURIComponent,o='object',n='AUWLBook',u='https://www.amazon.com/wishlist/add',r='readyState',T=setTimeout,a='setAttribute',g=function(){d[r]&&d[r]!='complete'?T(g,200):!w[n]?(s[a]('charset','UTF-8'),s[a]('src',u+'.js?loc='+e(l)),d.body.appendChild(s),f()):f()},f=function(){!w[n]?T(f,200):w[n].showPopover()};typeof s!=o?l.href=u+'?u='+e(l)+'&t='+e(d.title):g()}())" ><img src="http://g-ecx.images-amazon.com/images/G/01/gifts/registries/wishlist/uwl/ext/add-to-uwl-txt-md._V191754442_.gif" alt="ほしい物リストに追加する" align="absmiddle" name="Add to Wish List" border="0"></a>
@furahaclothing
furahaclothing / gist:5582479
Created May 15, 2013 08:39
wp-customer-review レビュー件数の表示(function.phpに記載)
function get_reviews_count( $status, $pageid) {
global $wpdb;
$returnvalue = 0;
if ($status == -1) {
$qry_status = '1=1';
} else {
$qry_status = "`status`=$status";
}
@furahaclothing
furahaclothing / gist:5140877
Created March 12, 2013 07:07
wordpress-カスタム投稿 rss
//RSSを独自出力
function custom_post_rss_set( $query ) {
if ( is_feed() ) {
$post_type = $query->get( 'post_type' );
if ( empty( $post_type ) ) {
$query->set( 'post_type', array( 'post', 'blog' ) );
}
return $query;
}
}
@furahaclothing
furahaclothing / gist:5070150
Created March 2, 2013 08:17
welcartでカテゴリー別で商品詳細ページを変える。(ex:カテゴリー3はsingle1.php。その他のカテゴリーはsingle4.phpを使う)
add_action('usces_action_template_redirect', 'my_action_template_redirect', 8);
function my_action_template_redirect(){
global $usces, $post, $usces_entries, $usces_carts, $usces_members, $usces_item, $usces_gp, $member_regmode;
if( is_single() && 'item' == $post->post_mine_type ) {
if (in_category('3')){
if(file_exists(get_stylesheet_directory() './single1.php')){
include(get_stylesheet_directory() .'/single1.php');
exist;
}
@furahaclothing
furahaclothing / gist:4749529
Created February 10, 2013 13:03
wordpress-スラッグからタクソノミー情報を取得する-
/*IDの取得*/
<?php echo get_term_by('slug',$term,$taxonomy)->term_id ?>
/*名前の取得*/
<?php echo get_term_by('slug',$term,$taxonomy)->name ?>
/*説明の取得*/
<?php echo term_description(get_term_by('slug',$term,$taxonomy)->term_id,$taxonomy); ?>
/*URLの取得*/
<?php echo get_term_link($term,$taxonomy); ?>
@furahaclothing
furahaclothing / gist:4749064
Created February 10, 2013 10:10
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>
@furahaclothing
furahaclothing / gist:4713447
Created February 5, 2013 10:01
welcartで(商品やカテゴリー)一覧で金額の部分に SOLDを出す
<?php if (usces_is_skus()) : usces_have_skus()?>
<?php if ( 'SOLD' == usces_the_itemZaiko('return')): ?>
<div class="price"><?php usces_the_itemZaiko(); ?></div>
<?php else: ?>
<div class="price"><?php _e('$', 'usces'); ?><?php usces_the_firstPrice(); ?><?php usces_guid_tax(); ?></div>
<?php endif; ?>
<?php endif; ?>
@furahaclothing
furahaclothing / gist:4671740
Last active December 11, 2015 22:48
welcart-お客様情報入力フォームの変更-function.php-
add_filter( 'usces_filter_furigana_form', 'my_filter_furigana', 10, 3);
add_filter( 'usces_filter_furigana_confirm_customer', 'my_filter_furigana', 10, 3);
add_filter( 'usces_filter_furigana_confirm_delivery', 'my_filter_furigana', 10, 3);
function my_filter_furigana( $furigana, $type, $values ){
return '';
}//*ふりがなの削除//
add_filter( 'usces_filter_after_zipcode', 'my_filter_after_zipcode', 10, 2);
function my_filter_after_zipcode( $str, $applyform ){
return 'ex';
@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>
@furahaclothing
furahaclothing / gist:3898157
Created October 16, 2012 08:58
wordpress-説明の箇所にhtmlを使えるようにする-
<? php remove_filter( 'pre_term_description', 'wp_filter_kses' ); ?>