More Related Content
Similar to Word press 3.5RC2 - パーフェクト functions.php -
Similar to Word press 3.5RC2 - パーフェクト functions.php - (20)
Word press 3.5RC2 - パーフェクト functions.php -
- 6. ● add_theme_support( 'post-formats' )
投稿フォーマット(記事の表示方法)を使えるよう設定する。
● register_nav_menu( 'primary' )
カスタムメニュー内のグローバルメニューを設定可能にす
る。
● add_theme_support( 'custom-background' )
テーマの背景色を設定。
- 21. wp_titleの子テーマからの書き換え例
function my_wp_title( $title, $sep ) {
global $paged, $page;
// 好きな処理
return $title;
}
function adjust_twentytwelvechild_wp_title() {
add_filter( 'wp_title', 'my_wp_title', 10, 2 );
remove_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
}
add_action('after_setup_theme','adjust_twentytwelvechild_wp_title');
- 24. Google Fonts APIを使ってる!
// httpsかhttpか判断してる
$protocol = is_ssl() ? 'https' : 'http';
// なんかオシャレな書き方…別にこんな書き方しなくても
$query_args = array(
'family' => 'Open+Sans:400italic,700italic,400,700',
'subset' => $subsets,
);
wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args,
"$protocol://fonts.googleapis.com/css" ), array(), null );
- 31. 質問タイム!
Q. IE対応
A. headのクラスをIEコンディショナルコメントで仕
込んでおくのは流行ってますね
Twenty Elevenでは使ってない
<!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
- 32. 質問タイム!
Q. Twenty Eleven のカスタマイズでテーマを作っ
てた人が Twenty Twelve に移行するには?
A. 完全に別モノなので難しいかも。作りなおすほう
がいい
テーマ開発者も違う人らしいですよ(naoさん情報)