我有一个空白的主题,纯粹是为了重定向到我的定制前端。我创建了一个functions.php,并将add_theme_support()放入其中,但没有结果。
index.php:
<meta content="0; URL='https://headless-cms.test''" http-equiv"refresh">
<!-- just in case the meta tag is not read properly, here is plan B: a JS redirect -->
<script type="text/javascript">
window.location = 'https://headless-cms.test';
</script>functions.php
add_action( 'after_setup_theme', 'headless_theme_setup' );
function headless_theme_setup() {
add_theme_support( 'post-thumbnails');
}
// Also tried these and still didn't show
//add_theme_support('post-thumbnails', array(
// 'post',
// 'page',
//));
//add_theme_support( 'post-thumbnails' );我刷新了管理面板,并在screen options下检查,但没有看到它。我用的是WP 5.0.2。
发布于 2018-12-29 19:26:43
问题是在公共/中的Wordpress安装与build/目录之间的符号链接不同步。添加函数后,我忘记运行yarn build。
我的目录结构如下:
site/
|__build/
|_wp/
|
|__/src/
|_wp/因此,我在src/中所做的更改并没有在构建之外编译。
发布于 2018-12-29 19:13:07
为我工作过,
add_action( 'after_setup_theme', 'headless_theme_setup' );
function headless_theme_setup() {
add_theme_support( 'post-thumbnails', array( 'post' ) );
}
WordPress版本5.0.2
https://wordpress.stackexchange.com/questions/324158
复制相似问题