add_theme_support() | 테마 기능 추가

|

요약

워드프레스의 모든 기능을 사용하려면 추가적으로 설정을 해주어야 합니다.

테마 지원 활성화 유무

get_theme_support( '{체크하고 싶은 기능}' )

현재 테마에서 사용되는 기능이 활성화 중인지 알 필요가 있습니다.
이 때는 위의 get_theme_support 기능을 통해 기능이 활성화 되어있는지 확인하면 좋습니다.

대표적인 추가 기능

/**
 * Essential theme supports
 * */
function theme_setup(){
    /** automatic feed link*/
    add_theme_support( 'automatic-feed-links' );
 
    /** tag-title **/
    add_theme_support( 'title-tag' );
 
    /** post formats */
    $post_formats = array('aside','image','gallery','video','audio','link','quote','status');
    add_theme_support( 'post-formats', $post_formats);
 
    /** post thumbnail **/
    add_theme_support( 'post-thumbnails' );
 
    /** HTML5 support **/
    add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );
 
    /** refresh widgest **/
    add_theme_support( 'customize-selective-refresh-widgets' );
 
    /** custom background **/
    $bg_defaults = array(
        'default-image'          => '',
        'default-preset'         => 'default',
        'default-size'           => 'cover',
        'default-repeat'         => 'no-repeat',
        'default-attachment'     => 'scroll',
    );
    add_theme_support( 'custom-background', $bg_defaults );
 
    /** custom header **/
    $header_defaults = array(
        'default-image'          => '',
        'width'                  => 300,
        'height'                 => 60,
        'flex-height'            => true,
        'flex-width'             => true,
        'default-text-color'     => '',
        'header-text'            => true,
        'uploads'                => true,
    );
    add_theme_support( 'custom-header', $header_defaults );
 
    /** custom log **/
    add_theme_support( 'custom-logo', array(
        'height'      => 60,
        'width'       => 400,
        'flex-height' => true,
        'flex-width'  => true,
        'header-text' => array( 'site-title', 'site-description' ),
    ) );
 
 
 
}
add_action('after_setup_theme','theme_setup');

사용 가능한 기능

'admin-bar'
'align-wide'
'core-block-patterns'
'custom-background'
'custom-header'
'custom-line-height'
'custom-logo'
'customize-selective-refresh-widgets'
'custom-spacing'
'custom-units'
'dark-editor-style'
'disable-custom-colors'
'disable-custom-font-sizes'
'editor-color-palette'
'editor-gradient-presets'
'editor-font-sizes'
'featured-content'
'menus'
'post-formats'
'starter-content'
'title-tag'
'wp-block-styles'
'widgets'
'widgets-block-editor'
'automatic-feed-links' // 5.9 이후 기본
'editor-styles' // 5.9 이후 기본
'html5' // 5.9 이후 기본 탑재
'post-thumbnails' // 5.9 이후 기본
'responsive-embeds' // 5.9 이후 기본

참조

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

클릭하여 복사