Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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
    r

    #396172

    Hi 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,
    Elliott

    #396389

    it 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
    rene

    #396878

    Hey!

    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,
    Elliott

    #396909

    hi 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, 2 months ago by isee.
    #396915

    Hey!

    Check if the featured image box appear with the default WordPress theme activated.

    Regards,
    Josue

    #396939

    hello :-)

    i checked:
    – with enfold default theme (no child)
    – with wordpress standard theme

    result: no pics :-(

    #396954

    Hi!

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.