$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>post thumbnails - Created blank theme for REST API, featured image not appearing on admin side|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

post thumbnails - Created blank theme for REST API, featured image not appearing on admin side

matteradmin10PV0评论

I have a blank theme purely to redirect to my custom front-end. I created a functions.php and put add_theme_support() inside it and to no avail.

index.php:

<meta content="0; URL='''" 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 = '';
</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' );

I refreshed the admin panel and checked under screen options and did not see it. I'm using WP 5.0.2.

I have a blank theme purely to redirect to my custom front-end. I created a functions.php and put add_theme_support() inside it and to no avail.

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' );

I refreshed the admin panel and checked under screen options and did not see it. I'm using WP 5.0.2.

Share Improve this question asked Dec 29, 2018 at 16:22 DanDan 1491 silver badge15 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

Worked for me,

add_action( 'after_setup_theme', 'headless_theme_setup' );
function headless_theme_setup() {
    add_theme_support( 'post-thumbnails',  array( 'post' ) );
}

WordPress version 5.0.2

The issue was the symbolic link between my Wordpress install in my public/ and build/ directory was out of sync. I forgot to run yarn build after adding the function.

My directory structure is like this:

site/
|__build/
   |_wp/
|
|__/src/
   |_wp/

So the changes I made in src/ were not being compiled off the build.

Post a comment

comment list (0)

  1. No comments so far