1. 主页
  2. 文档
  3. WordPress函数
  4. add_theme_support
  5. 所有功能(theme features)

所有功能(theme features)

版本:wordpress5.3.2-zh_CN

打开theme.php

feature
1post-thumbnailsAll post types are already supported
2post-formats
3html5You can’t just pass ‘html5’, you need to pass an array of types
4custom-logo
5custom-header-uploads
6custom-header
7custom-background
8title-tag
其他:
9editor-style
automatic-feed-links

2020主题用到了哪些?

// Add default posts and comments RSS feed links to head.
add_theme_support( ‘automatic-feed-links’ );
// Custom background color.
add_theme_support(
‘custom-background’,
array(
‘default-color’ => ‘f5efe0’,
)
);
add_theme_support( ‘post-thumbnails’ );
// Set post thumbnail size.
set_post_thumbnail_size( 1200, 9999 );
// Add custom image size used in Cover Template.
add_image_size( ‘twentytwenty-fullscreen’, 1980, 9999 );
add_theme_support(
‘custom-logo’,
array(
‘height’ => $logo_height,
‘width’ => $logo_width,
‘flex-height’ => true,
‘flex-width’ => true,
)
);
add_theme_support( ‘title-tag’ );
add_theme_support(
‘html5’,
array(
‘search-form’,
‘comment-form’,
‘comment-list’,
‘gallery’,
‘caption’,
‘script’,
‘style’,
)
);
// Add support for full and wide align images.
add_theme_support( ‘align-wide’ );
if ( is_customize_preview() ) {
require get_template_directory() . ‘/inc/starter-content.php’;
add_theme_support( ‘starter-content’, twentytwenty_get_starter_content() );
}
// Add theme support for selective refresh for widgets.
add_theme_support( ‘customize-selective-refresh-widgets’ );
这篇文章对您有用吗?

我们要如何帮助您?