カスタマイザーメモ 01

functions.php

function theme_customizer_extension($wp_customize) {

$wp_customize->add_section( 'header_01', array(
'title' => __( 'TOP ヘッダー エリア カスタマイズ', 'celtisone' ), コンテンツエリア 01 セクション
'priority' => 1,
) );

 

$wp_customize->add_setting('set_img_url_4');

//テーマカスタマイザー画面に表示されるフォームの入力要素
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'set_img_url_4', array(
'label' => '画像を選択', //設定ラベル
'section' => 'header_01',
'description' => '画像をアップロードすると指定箇所の画像が入れ替わります。',
)));

$wp_customize->add_setting( 'checkbox_02', array(
'default' => true,
// 'sanitize_callback' => 'theme_slug_sanitize_checkbox',
));
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'checkbox_02', array( # チェックボックス
'label' => __( 'エリアを確認する', 'theme' ),
'description' => __( '対象エリアを確認できます', 'theme' ),
'section' => 'header_01',
'type' => 'checkbox',
)));

 

/* カラー */

$wp_customize->add_setting( 'content4_ti_color_01', array(
'default' => '#998675;',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content4_ti_color_01_c1', array(
'label' => 'タイトル_01_背景色',
'section' => 'header_01',
'settings' => 'content4_ti_color_01',
)));

 

/* テキスト */

$wp_customize->add_setting ('content5_title', array(
'default' => "TYPE", /* コンテンツ5 TYPE */
'type' => 'option',
'transport' => 'refresh',
));
$wp_customize->add_control('content5_title_c',array(
'settings' => 'content5_title',
'label' => 'コンテンツ5_タイトル',
'section' => 'content5',
'type' => 'text',
));