This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( ‘init’, ‘create_post_type’ ); | |
function create_post_type() { | |
register_post_type( ‘blog’, /* post-type */ | |
array( | |
‘labels’ => array( | |
‘name’ => __( ‘ブログ’ ), | |
‘singular_name’ => __( ‘ブログ’ ) | |
), | |
‘public’ => true, | |
‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘custom-fields’ ,’comments’ ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!is_home() && !is_page() || is_page_template() ) { | |
echo '<h2 class="posttype-' .get_post_type(). '">'; | |
if ( get_post_type() === 'post' ){ | |
echo 'カスタム投稿タイプが「post」のときのタイトル'; | |
} else { | |
$customPostTypeObj = get_post_type_object(get_post_type()); | |
echo esc_html($customPostTypeObj->labels->name); | |
} | |
echo '</h2>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'getarchives_where', 'my_getarchives_where', 10, 2 ); | |
function my_getarchives_where( $where, $r ) { | |
global $taxonomy_getarchives_data; | |
if ( isset($r['post_type']) ){ | |
$taxonomy_getarchives_data['post_type'] = $r['post_type']; | |
$where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', | |
$where ); | |
} | |
return $where; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul><li><h3>合計金額:¥<?php usces_totalprice_in_cart(); ?>(送料・税別)</h3></li> | |
<li>現在の商品数:<?php usces_totalquantity_in_cart(); ?></li> | |
<a href="/usces-cart/">カートの中身を見る | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li id="categories"> | |
<h2><?php _e('Categories:'); ?></h2> | |
<form action="<?php bloginfo('url'); ?>/" method="get"> | |
<?php | |
$select = wp_dropdown_categories('show_option_none=Select Category&show_count=1&orderby=name&echo=0&selected=6'); | |
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select); | |
echo $select; | |
?> | |
<noscript><input type="submit" value="View" /></noscript> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#search { | |
-webkit-transition-duration: 400ms; | |
-webkit-transition-property: width, background; | |
-webkit-transition-timing-function: ease; | |
-moz-transition-duration: 400ms; | |
-moz-transition-property: width, background; | |
-moz-transition-timing-function: ease; | |
-o-transition-duration: 400ms; | |
-o-transition-property: width, background; | |
-o-transition-timing-function: ease; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 –> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |