WP中的精选图片未显示

Added the line of code in my function.php file

add_theme_support('post-thumbnails');

After going saving, and looking at my screen options, Featured images still wasn't showing. I even went as far back to check if my Custom Fields was correct and I had it unmarked to show

I actually found out the answer just last night. In the CPT UI on the left hand side there is a settings area "Click headings to reveal available options.", click on the settings caret and at the bottom under supports select Featured Images. And then of course going into your function.php and adding

add_theme_support('post-thumbnails' );

enter image description here

hi #EliCollins Use this code. It should work

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

First: (I assume it's a typo in your description): Change function.phpto functions.php

Second: Try to call add_theme_support('post-thumbnails') within a function attached to the after_setup_theme hook as shown in the documentation.

// Register Theme Features
function custom_theme_features()  {

    // Add theme support for Featured Images
    add_theme_support( 'post-thumbnails' );
}

// Hook into the 'after_setup_theme' action
add_action( 'after_setup_theme', 'custom_theme_features' );

I hope these steps will fix your issue, otherwise it would be necessary to provide more of your code