Created
May 20, 2012 18:25
-
-
Save miya0001/2759039 to your computer and use it in GitHub Desktop.
テーマカスタマイザー
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 | |
add_action( 'customize_register', 'themename_customize_register' ); | |
function themename_customize_register($wp_customize) { | |
// ここでいろいろと | |
} | |
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 | |
add_action( 'customize_register', 'themename_customize_register' ); | |
function themename_customize_register($wp_customize) { | |
// セクションを追加 | |
$wp_customize->add_section( 'twentyeleven_logo_image', array( | |
'title' => 'ロゴ画像', | |
'priority' => 15, | |
) ); | |
} |
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 | |
add_action( 'customize_register', 'themename_customize_register' ); | |
function themename_customize_register($wp_customize) { | |
// セクションを追加 | |
$wp_customize->add_section( 'twentyeleven_logo_image', array( | |
'title' => 'ロゴ画像', | |
'priority' => 15, | |
) ); | |
// セクションの動作設定 | |
$wp_customize->add_setting( 'twentyeleven_logo_image', array( | |
'default' => '', | |
'type' => 'option', | |
'capability' => 'edit_theme_options', | |
) ); | |
} |
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 | |
add_action( 'customize_register', 'themename_customize_register' ); | |
function themename_customize_register($wp_customize) { | |
// セクションを追加 | |
$wp_customize->add_section( 'twentyeleven_logo_image', array( | |
'title' => 'ロゴ画像', | |
'priority' => 15, | |
) ); | |
// セクションの動作設定 | |
$wp_customize->add_setting( 'twentyeleven_logo_image', array( | |
'default' => '', | |
'type' => 'option', | |
'capability' => 'edit_theme_options', | |
) ); | |
// セクションのUIを作成する | |
$wp_customize->add_control( new WP_Customize_Image_Control( | |
$wp_customize, | |
'logo_Image', | |
array( | |
'label' => '画像', | |
'section' => 'twentyeleven_logo_image', | |
'settings' => 'twentyeleven_logo_image', | |
) | |
) ); | |
} |
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
<hgroup> | |
<?php if (get_option('twentyeleven_logo_image')): ?> | |
<h1 id="site-title""><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img alt="<?php bloginfo( 'name' ); ?>" src="<?php echo esc_url(get_option('twentyeleven_logo_image')); ?>" /></a></h1> | |
<?php else: ?> | |
<h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1> | |
<?php endif; ?> | |
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2> | |
</hgroup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment