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 | |
$args = array( | |
'posts_per_page' => 10, //取得する結果数 | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'category', | |
'terms' => array(111, 222, 333), //カテゴリーIDを指定する | |
'include_children' => true, | |
'field' => 'term_id', |
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
//gistのembed対応(WordPressのエディターにURLを入力するだけで利用できる) | |
wp_embed_register_handler( 'gist', '/https?:\/\/gist\.github\.com\/([a-z0-9]+)\/([a-z0-9]+)(#file=.*)?/i', 'wp_embed_register_handler_for_gist' ); | |
if ( !function_exists( 'wp_embed_register_handler_for_gist' ) ): | |
function wp_embed_register_handler_for_gist( $matches, $attr, $url, $rawattr ) { | |
$embed = sprintf( | |
'<script src="https://gist.github.com/%1$s/%2$s.js"></script>', | |
esc_attr( $matches[1] ), | |
esc_attr( $matches[2] ) | |
); | |
return apply_filters( 'embed_gist', $embed, $matches, $attr, $url, $rawattr ); |
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
#london { | |
background-color: gray; | |
} | |
#Batman { | |
background-color: #000; | |
opacity: 0.3; | |
} | |
#hulk { |
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="column-wrap column-2"> | |
<div class="column-left"> | |
<div class="column-wrap column-2"> | |
<div class="column-left"> 左側に入力する内容1 </div> | |
<div class="column-right"> 右側に入力する内容1 </div> | |
</div> | |
</div> | |
<div class="column-right"> | |
<div class="column-wrap column-2"> | |
<div class="column-left"> 右側に入力する内容2 </div> |
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
function add_toc_before_1st_h2($the_content){ | |
//投稿ページだと表示しない | |
if (!is_single_toc_visible() && is_single()) { | |
return $the_content; | |
} | |
//固定ページだと表示しない | |
if (!is_page_toc_visible() && is_page()) { | |
return $the_content; | |
} |
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
function get_normal_adsense_responsive_code($format = DATA_AD_FORMAT_AUTO, $code = null){ | |
//$codeに広告コードが入っている場合はそこから取得する(無い場合はテーマ設定のAdSenseコードを利用) | |
if (get_adsense_ids($code)) { | |
$data_ad_layout = null; | |
//フォーマットが設定されていない場合はフォーマットをコード内から取得 | |
if ($format == 'none') { | |
if (preg_match('{data-ad-format="([^"]+?)"}i', $code, $m)) { | |
if (isset($m[1])) { |
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_active_sidebar( 'index-bottom' ) ){ | |
dynamic_sidebar( 'index-bottom' ); | |
}; ?> | |
<?php |
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
function get_skin_url(){ | |
$skin_file = get_theme_option(OP_SKIN_URL, ''); | |
if (is_single('m-sora')) { | |
$skin_file = get_template_directory_uri().'/skins/m-sora/style.css'; | |
} elseif (is_single('itsumono-skin')) { | |
$skin_file = get_template_directory_uri().'/skins/skin-ganchan02/style.css'; | |
} elseif (is_single('odekake')) { | |
$skin_file = get_template_directory_uri().'/skins/skin-ganchan11/style.css'; | |
} elseif (is_single(array('modernblack', '0-6-2'))) { | |
$skin_file = get_template_directory_uri().'/skins/skin-modernblack/style.css'; |
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
SELECT * FROM`wp_postmeta`WHERE`meta_key`= 'is_ads_removed_in_page' AND`meta_value`= 'on' |
OlderNewer