asteria 에 로고 편집 붙이기 > wp테마

본문 바로가기

검색취소

asteria 에 로고 편집 붙이기

검색 이전 다음 목록

본문

themes/asteria-lite/functions.php 

 

함수 추가 :

 

 

 

// 김성대 2015-04-05 추가

 

/* Enable custom logo */

 

/* Register custom sections, settings, and controls. */

add_action( 'customize_register', 'omega_customize_logo_register' );

 

 

/**

 * Registers custom sections, settings, and controls for the $wp_customize instance.

 *

 * @since 0.3.2

 * @access private

 * @param object $wp_customize

 */

function omega_customize_logo_register( $wp_customize ) {

 

/* Add the footer section. */

$wp_customize->add_section(

'title_tagline',

array(

'title'      => esc_html__( 'Branding', 'omega' ),

'priority'   => 1,

'capability' => 'edit_theme_options'

)

);

 

/* Add the 'custom_logo' setting. */

$wp_customize->add_setting(

"custom_logo",

array(

'default'              => '',

'type'                 => 'theme_mod',

'capability'           => 'edit_theme_options',

'sanitize_callback'    => 'sanitize_text_field',

//'sanitize_js_callback' => 'omega_customize_sanitize',

//'transport'            => 'postMessage',

)

);

 

/* Add the textarea control for the 'custom_css' setting. */

$wp_customize->add_control(

new WP_Customize_Image_Control(

$wp_customize,

'custom_logo',

array(

'label'    => esc_html__( 'Logo', 'omega' ),

'section'  => 'title_tagline',

'settings' => "custom_logo",

)

)

);

 

/* Add the 'custom_favicon' setting. */

$wp_customize->add_setting(

"custom_favicon",

array(

'default'              => '',

'type'                 => 'theme_mod',

'capability'           => 'edit_theme_options',

'sanitize_callback'    => 'sanitize_text_field',

//'sanitize_js_callback' => 'omega_customize_sanitize',

//'transport'            => 'postMessage',

)

);

 

/* Add the textarea control for the 'custom_css' setting. */

$wp_customize->add_control(

new WP_Customize_Image_Control(

$wp_customize,

'custom_favicon',

array(

'label'    => esc_html__( 'Favicon', 'omega' ),

'section'  => 'title_tagline',

'settings' => "custom_favicon",

)

)

);

 

}

 

add_action( 'wp_head', 'omega_favicon' );

add_action( 'admin_head', 'omega_favicon' );

 

function omega_favicon() {

if ( $favicon = get_theme_mod( 'custom_favicon' ) )

        echo '<link rel="shortcut icon" href="'.  esc_url( $favicon )  .'"/>'."\n";

}

 

 

 

 

#/themes/asteria-lite/head4.php 에

    <div class="logo">

<?

 

if ( $logo = get_theme_mod( 'custom_logo' ) ) {

$title = sprintf( '<div itemscope itemtype="http://schema.org/Organization" class="site-title"><a itemprop="url" href="%1$s" title="%2$s" rel="home"><img itemprop="logo" alt="%3$s" src="%4$s"/></a></div>', home_url(), esc_attr( $title ), esc_attr( $title ), $logo );

} else {

if (is_home()) {

$title = sprintf( '<h1 class="site-title" itemprop="headline"><a href="%1$s" title="%2$s" rel="home">%3$s</a></h1>', home_url(), esc_attr( $title ), $title );

} else {

$title = sprintf( '<h2 class="site-title" itemprop="headline"><a href="%1$s" title="%2$s" rel="home">%3$s</a></h2>', home_url(), esc_attr( $title ), $title );

}

}

echo $title;

 

/* Get the site description.  If it's not empty, wrap it with the appropriate HTML. */

if ( $desc = get_bloginfo( 'description' ) ) {

$desc = sprintf( '<h3 class="site-description"><span>%1$s</span></h3>', $desc );

echo $desc;

}

 

 

?> 

 

등록된 댓글이 없습니다.

검색취소

wp테마

검색
  • no image
  • logo 메뉴 분리

    themes/asteria-lite/style.css      /*Theme Name: Asteria LiteDescription: Asteria Lite is a clean responsive theme with …

  • no image
  • Asteria Lite 위젯수정하기

    1. 로고 를 수정하기위해  html 편집가능한 위젯을 추가하라   TinyMCE Advanced​   -> 편집기에 html  사용가능 추가   Black Studio TinyMCE Widget  -> …

  • 위젯
  • 위젯

    http://asterialite.towfiqi.com/   Asteria Lite by Towfiq I.PreviewDownloadLast updated: 2015년 3월 2일Theme HomepageAsteria…

?>