Add favorite image to custom post type

I have a plugin that creates a custom post type called popup. But it does not add Featured Image metadata on the edit page. I can enter the plugin and add it like this.

'supports' => apply_filters( 'popmake_popup_supports', array( 'title', 'editor', 'revisions', 'author', 'thumbnail' ) ),

This works until the plugin is updated. In my topic, I added the following:

add_theme_support('post-thumbnails', array('post', 'page', 'popup'));

But this does not mean that Meta-Box is a type of user publication.

Question: Can I add this function outside of my plugin, maybe in my functions.php file, so I can update the plugin?

EDIT: The use of the free Advanced User Fields plugin has ended , allowing more than one image to be added. http://www.advancedcustomfields.com/

+4
source share
1 answer

You are now using the correct code in the functions.php file. He will work. Follow my instructions and use the line below in the functions.php file. Here is the code.

function custom_theme_setup() {
    add_theme_support( 'post-thumbnails', array('post', 'page', 'popup') );
}

add_action( 'after_setup_theme', 'custom_theme_setup');

Now, if it still does not work, please indicate the priority of the action. See here .

Like this:

add_action( 'after_setup_theme', 'custom_theme_setup',2 );
0
source

All Articles