Skip to content

Instantly share code, notes, and snippets.

div.kadomaru {
border-radius: 20px; /* CSS3 */
-moz-border-radius: 20px; /* Firefox */
-webkit-border-radius: 20px; /* Safari,Chrome */
border: 3px green solid; /* border */
background-color: #ccffcc; /* background */
}
@furahaclothing
furahaclothing / opacity
Created August 10, 2012 03:53
透過(opacity)
div#hoge a:hover img
{
opacity:0.8;
filter: alpha(opacity=80);
-ms-filter: "alpha( opacity=80 )";
background: #fff;
}
@furahaclothing
furahaclothing / fly-out menus
Created August 10, 2012 03:55
fly-out menus(フライアウトメニュー)
/* common styling */
.menu1{
font-family: arial, sans-serif; width:100px; height:180px; position:relative; font-size:11px; margin:30px 0; background:#eee; padding:25px 10px; border:1px solid #888;
}
.menu1 ul {
padding:0; margin:0; list-style-type: none;
}
.menu1 ul li ul {
visibility:hidden; position:absolute; height:0; overflow:hidden; top:-1px; left:99px;
}
@furahaclothing
furahaclothing / single.php
Created August 10, 2012 04:06
single.phpに同じカテゴリー内の別の記事をランダム表示
<?php $cat = get_the_category(); $cat = $cat[0]; ?>
<?php $bk_wp_query = clone $wp_query; ?>
<?php queryposts( array('cat' => $cat->cat_ID, 'showposts' => 5,
'orderby' => 'rand', 'post_not_in' => array($post->ID)) ); ?>
<?php while (have_posts()) : the_post(); ?>
"><?php the_title(); ?>
@furahaclothing
furahaclothing / gist:3310998
Created August 10, 2012 04:12
カスタム投稿にもタグとカテゴリーを加える-function.php-
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’ ),
@furahaclothing
furahaclothing / gist:3312759
Last active October 8, 2015 09:29
カスタム投稿の月別アーカイブ-function.php-
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;
}
@furahaclothing
furahaclothing / gist:3312764
Created August 10, 2012 09:05
カスタム投稿の月別アーカイブ-sidebar.php-
<?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>';
@furahaclothing
furahaclothing / gist:3312774
Created August 10, 2012 09:07
welcart-カートの中を表示-
<ul><li><h3>合計金額:¥<?php usces_totalprice_in_cart(); ?>(送料・税別)</h3></li>
<li>現在の商品数:<?php usces_totalquantity_in_cart(); ?></li>
<a href="/usces-cart/">カートの中身を見る
</ul>
@furahaclothing
furahaclothing / gist:3312783
Created August 10, 2012 09:10
wordpress-カテゴリーのメニューをドロップダウン-
<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>
@furahaclothing
furahaclothing / gist:3312795
Created August 10, 2012 09:12
css-伸びる検索窓-
#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;