wordpress - 在functions.php Word Press中添加主题支持后,自定义徽标按钮不出现
问题描述
我正在按照教程为 Word Press 创建自定义主题。我正在尝试添加自定义徽标主题支持,但按钮未出现在 Word Press 面板中。
function fja_theme_support()
{
add_theme_support('custom-logo');
}
add_action('after_theme_setup', 'fja_theme_support);
解决方案
这是主题开发人员手册中的一个示例
Hook 应该被命名after_setup_theme
,提供一系列额外的设置 - 你可以在这里找到它们
function themename_custom_logo_setup() {
$defaults = array(
'height' => 100,
'width' => 400,
'flex-height' => true,
'flex-width' => true,
'header-text' => array( 'site-title', 'site-description' ),
'unlink-homepage-logo' => true,
);
add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'themename_custom_logo_setup' );
推荐阅读
- javascript - Puppeteer:page.evaluate 抛出 TypeError:无法读取 null 的 innerText
- python - 删除链表中的第n个到第m个节点
- python - 在字典中存储为列表的值
- amazon-web-services - 对于不支持发件人 ID 的国家/地区,AWS SNS SMS 的发件人名称是否会发生变化?
- python - 找不到来自 NBA 统计网站的 BeautifulSoup Python
- drupal-8 - 如何从 Drupal 8 中的颜色模块获取保存的值
- angular - Angular获取当前路线
- ruby - 在 iRuby 中显示多个图形
- c - 如何在 .NET 应用程序中执行 C 代码?
- gradle - Gradle 依赖版本后缀