主題下載次數(shù)
服務(wù)網(wǎng)站數(shù)量
本站主題用戶(hù)
在看twenty-fourteen這個(gè)官網(wǎng)主題時(shí),會(huì)發(fā)現(xiàn)主題有 背景和頭部設(shè)置。
這個(gè)是怎么出來(lái)的呢?
其實(shí)是用到了 add_theme_support 這個(gè)函數(shù)。
add_theme_support( 'custom-background', apply_filters( 'twentyfourteen_custom_background_args', array(
'default-color' => 'f5f5f5',
) ) );
require get_template_directory() . '/inc/custom-header.php';
———–
比如縮略圖,也是由這個(gè)函數(shù)在function.php里設(shè)置的。
代碼:
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 672, 372, true );
add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
————-
還有文章格式,也是由它設(shè)置的:
代碼:
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',
) );
——————–
http://codex.WordPress.org/Function_Reference/add_theme_support
主題貓WP建站,累計(jì)幫助1300+客戶(hù)成功建站,為站長(zhǎng)提供支持!
立刻開(kāi)啟你的建站之旅