Tagged: backend, Custom Post Type, featured image, image, page
-
AuthorPosts
-
February 13, 2015 at 5:45 pm #395911
hi there,
i try to show featured image in the backend for pages and some custom post types.
for doing so this would be right in functions.php:
add_theme_support( 'post-thumbnails', array( 'post', 'page', 'CPT-DEMO1', 'CPT-DEMO2', 'CPT-DEMO3' ) );
but i did not manage to make happening whats promised :-)
may you can help me?
greez
rFebruary 14, 2015 at 5:44 pm #396172Hi rene!
Your code should be working I think. You can also use this plugin, https://wordpress.org/plugins/multiple-post-thumbnails/, to easily add support for your custom post types.
Regards,
ElliottFebruary 15, 2015 at 4:15 pm #396389it should… but it does not ./
i try to minmize plugins, so i try to solve it like this.
may there is a function for theme integration which eliminates mine?
greez
reneFebruary 16, 2015 at 6:17 pm #396878Hey!
What this code does is allow the “Featured Image” option for whatever posts you set it for. We already call it on line 256 in /enfold/functions-enfold.php.
add_theme_support( 'post-thumbnails' );
So you shouldn’t need to call it again.
Is the problem that you created some custom post types but are unable to set their featured image? Perhaps you need to set the “supports -> thumbnails” option when you register the post type, http://codex.wordpress.org/register_post_type.
Regards,
ElliottFebruary 16, 2015 at 6:38 pm #396909hi again elliott,
– my post types support featured images (what means i can set it in the post, and did so)
– all CPTs are set up with “types-plugin”
– i added layout builder possibility to all CPTs with this code:add_filter('avf_builder_boxes', 'avia_register_meta_boxes', 10, 1); function avia_register_meta_boxes($boxes) { if(!empty($boxes)) { foreach($boxes as $key => $box) { $boxes[$key]['page'][] = 'CPT1'; $boxes[$key]['page'][] = 'CPT2'; $boxes[$key]['page'][] = 'CPT3'; } } return $boxes; }
may one of these points affect missfunction?
greez
rene- This reply was modified 9 years, 9 months ago by isee.
February 16, 2015 at 6:42 pm #396915Hey!
Check if the featured image box appear with the default WordPress theme activated.
Regards,
JosueFebruary 16, 2015 at 6:53 pm #396939hello :-)
i checked:
– with enfold default theme (no child)
– with wordpress standard themeresult: no pics :-(
February 16, 2015 at 7:14 pm #396954Hi!
Then the problem is not related to the theme but with how you are creating the post types with the Types plugin.
I’d suggest you using a different approach for this:
http://codex.wordpress.org/Function_Reference/register_post_type
http://generatewp.com/post-type/Best regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.