要更改WordPress主题的标志,您可以按照以下步骤操作:
function my_theme_setup() {
add_theme_support( 'custom-logo', array(
'height' => 80,
'width' => 260,
'flex-width' => true,
'flex-height' => true,
) );
}
add_action( 'after_setup_theme', 'my_theme_setup' );
这将允许您上传和设置自定义标志,而不是默认的WordPress标志。在这里,我们使用了 add_theme_support()
功能来添加自定义标志支持,然后设置其高度和宽度的值。