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_action('admin_menu', 'add_keywords'); | |
add_action('save_post', 'save_keywords'); | |
function add_keywords(){ | |
add_meta_box('keywords', 'キーワード', 'insert_keywords', , 'normal', 'high'); | |
} | |
function insert_keywords(){ | |
global $post; |
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
// CSSのラベルの設定などは、各自で行なってください | |
// get_post_meta($post->ID, 'keywords', true); を使っているので、keywordsというカスタムフィールドを作成してください | |
// | |
//seo columns | |
//表示したい投稿タイプを設定 | |
$theme_opt['post_type'] = array('post','blog'); | |
if( !empty( $theme_opt['post_type'] ) && is_admin() ){ | |
foreach( $theme_opt['post_type'] as $post_type => $value ){ |
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
.wp-list-table #words_count { | |
width: 280px; } | |
.wp-list-table .column_badge { | |
color: white; | |
padding: 3px 7px; | |
margin-left: 10px; | |
border-radius: 4px; | |
font-size: 90%; } |
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 set_post_attachment_loop(){ | |
if( !empty($_GET) && $_GET['set_post_attachment'] ){ | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'meta_key' => '_thumbnail_url', | |
'meta_value' => 'null', |
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 set_post_attachment(){ | |
global $post; | |
$_custom = get_post_custom($post->ID); | |
if( !empty($_custom['_thumbnail_url']) ){ | |
set_new_attachment($_custom['_thumbnail_url'][0]); | |
} |
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 set_attach_check(){ | |
$attach_check = []; | |
return; | |
} | |
add_action( 'export_wp', 'set_attach_check' ); | |
function add_attachment_url( $post ){ | |
global $post; | |
global $attach_check; |
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 my_child_meta($contactmethods) { | |
//項目の追加 | |
$contactmethods['childname_1'] = '一人目のお名前'; | |
$contactmethods['childbirth_1'] = 'お誕生日'; | |
return $contactmethods; |