This file contains hidden or 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_meta_box('ctameta_box', 'CTA設定', 'bzb_post_cta', 'page', 'normal', 'low'); |
This file contains hidden or 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_category('category1')){ ?> | |
/* category1専用のCSSファイルを読み込み */ | |
<link rel="stylesheet" type="text/css" href="/css/css1.css"> | |
<?php }elseif('category2'){ ?> | |
/* category2専用のCSSファイルを読み込み */ | |
<link rel="stylesheet" type="text/css" href="/css/css2.css"> |
This file contains hidden or 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_category($category)){ ?> | |
/* ここに特定のカテゴリーページでの処理を記述する */ | |
<?php } ?> |
This file contains hidden or 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 | |
$original = 'XXXXXYYYYYZZZZZ'; | |
$customize = '' | |
/* 全文削除 */ | |
echo substr_replace($original, $customize, 0) . "<br />\n"; | |
/* 「YYYYY」を削除 */ | |
echo substr_replace($original, $customize, 5, 5) . "<br />\n"; |
This file contains hidden or 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 | |
$original = 'XXXXX/ZZZZZ'; | |
$customize = 'YYYYY' | |
/* 文字列の「ZZZZZ」を「YYYYY」に置換*/ | |
echo substr_replace($original, $customize, 6) . "<br />\n"; | |
echo substr_replace($original, $customize, 6, 5) . "<br />\n"; | |
echo substr_replace($original, $customize, -5) . "<br />\n"; | |
echo substr_replace($original, $customize, -5, 5) . "<br />\n"; |
This file contains hidden or 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 | |
$original = 'XXXXX'; | |
$customize = 'YYYYY' | |
/* 文字列の先頭に挿入「YYYYYXXXXX」 */ | |
echo substr_replace($original, $customize, 0, 0) . "<br />\n"; | |
/* 文字列の3文字目から挿入「XXYYYYYXXX」 */ | |
echo substr_replace($original, $customize, 2, 0) . "<br />\n"; |
This file contains hidden or 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
substr_replace ( $string , $replacement , $start [, $length ] ) |
This file contains hidden or 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 | |
$original = 'XXXXX'; | |
$customize = 'YYYYY' | |
/* 文字列「XXXXX」を「YYYYY」に置換 */ | |
echo substr_replace($original, $customize, 0) . "<br />\n"; | |
echo substr_replace($original, $customize, 0, strlen($original)) . "<br />\n"; | |
?> |
This file contains hidden or 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_bzb_meta_tags() { | |
add_meta_box('bzb_meta_tags', 'メタタグを設定', 'bzb_meta_tags', 'post', 'normal', 'high'); | |
add_meta_box('bzb_meta_tags', 'メタタグを設定', 'bzb_meta_tags', 'voice', 'normal', 'high'); | |
} |
This file contains hidden or 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_meta_box('bzb_meta_tags', 'メタタグを設定', 'bzb_meta_tags', 'カスタム投稿タイプ名', 'normal', 'high'); | |
<!-- 省略 --> |
NewerOlder