Closed nathanaelphilip closed 9 years ago
You also need to add your custom post type slug into the supports.config.php
(which acts as the core add_theme_support
function). Add your product
to the post-thumbnails parameter like so:
'post-thumbnails' => array('post', 'product'),
I feel dumb.
Hi there. I'm doing something similar, however my custom post type is in a plugin. Even though the post type in the plugin supports thumbnails, I still had to go into the supports.config.php file and add the custom post type there. Is there anyway to avoid this dependency between plugin and framework? Thanks!
Hi,
you can still call inside your plugin, the add_theme_support('post-thumbnails', array( 'your-cpt' ))
function so you can add thumbnails for your custom post type.
The supports.config.php
file is only for the theme with pre-populated values. Behind the scenes, it still calls the same add_theme_support()
function.
Hope this helps.
Yeh, for some reason that wasn't working. I started out by doing that like normal. And finally I started poking around on Google and found this thread. Once I added the custom post type to the supports.config.php everything was fine. shrug
I'll try testing my plugin outside of Themosis and try to troubleshoot it that way.
And what happened when de-activating the themosis-theme? Try your plugin with the twenty-fifteen theme and let me know how it works. If there is still an issue, can you open a new issue and post your plugin/custom post type code so I can check?
I removed the custom post type from supports.config.php. I then activated the twenty-fourteen theme and the featured image shows up just fine on the plugin. I'll open a new issue ticket once my plugin is finished though if you'd like.
So there is only a call to add_theme_support
inside your plugin now? Yes you can still post your issue later so I can review it and check if there is no issue with the framework. Thanks.
I’ve added thumbnail support to my custom post type, but it’s not showing up in the backend. I’ve added support for post thumbnails and they show up under Posts, but not Products.