在 Wordpress 上开发新主题时,我注意到 add_theme_support 对我不起作用。我调用<?php wp_head();?>
在头部结束之前 <?php wp_footer();?>
在 body 结束之前。我正在使用 Wordpress 版本 4.1.1。谁能帮我解决这个问题?尝试了很多次后我很累,但没有运气:(
最佳答案
您在哪个 Hook 上添加了 add_theme_support
?
请尝试 after_setup_theme
钩子(Hook),如下例所示:
add_action('after_setup_theme', 'my_function_after_setup_theme');
function my_function_after_setup_theme() {
add_theme_support('automatic-feed-links');
}
关于php - add_theme_support 不适用于 functions.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37194798/