Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19259

    With the latest release of the choices theme i can’t define a “featured image”.

    So some other plugins, that uses this, faild (e.g. RSS images, …)

    #102957

    Hi naranili,

    Go into the theme files and open functions-choices.php. Look for:

    //remove post thumbnails from pages, posts and various custom post types
    if(!function_exists('avia_remove_post_thumbnails'))
    {
    add_theme_support( 'post-thumbnails' );

    add_action('posts_selection', 'avia_remove_post_thumbnails');
    add_action('init', 'avia_remove_post_thumbnails');
    add_filter('post_updated_messages','avia_remove_post_thumbnails');
    function avia_remove_post_thumbnails($msg)
    {
    global $post_type;
    $remove_when = array('post','page','portfolio');

    if(is_admin())
    {
    foreach($remove_when as $remove)
    {
    if($post_type == $remove || (isset($_GET['post_type']) && $_GET['post_type'] == $remove)) { remove_theme_support( 'post-thumbnails' ); };
    }
    }

    return $msg;
    }
    }

    and replace it with:

    //remove post thumbnails from pages, posts and various custom post types
    //if(!function_exists('avia_remove_post_thumbnails'))
    //{
    add_theme_support( 'post-thumbnails' );
    //
    // add_action('posts_selection', 'avia_remove_post_thumbnails');
    // add_action('init', 'avia_remove_post_thumbnails');
    // add_filter('post_updated_messages','avia_remove_post_thumbnails');
    // function avia_remove_post_thumbnails($msg)
    // {
    // global $post_type;
    // $remove_when = array('post','page','portfolio');
    //
    // if(is_admin())
    // {
    // foreach($remove_when as $remove)
    // {
    // if($post_type == $remove || (isset($_GET['post_type']) && $_GET['post_type'] == $remove)) { remove_theme_support( 'post-thumbnails' ); };
    // }
    // }
    //
    // return $msg;
    // }
    //}

    This should be lines around lines 325-348.

    You can then set the featured image in the Add Image pop up that appears when adding media to the visual editor.

    Regards,

    Devin

    #102958

    Doesn’t work with WP 3.5

    I don’T have a link at the Media-Upload to define a featured media.

    #102959

    I think this must be :

    //remove post thumbnails from pages, posts and various custom post types
    if(!function_exists('avia_remove_post_thumbnails'))
    {
    add_theme_support( 'post-thumbnails' );

    // add_action('posts_selection', 'avia_remove_post_thumbnails');
    // add_action('init', 'avia_remove_post_thumbnails');
    // add_filter('post_updated_messages','avia_remove_post_thumbnails');
    // function avia_remove_post_thumbnails($msg)
    // {
    // global $post_type;
    // $remove_when = apply_filters('avia_remove_post_thumbnails', array('post','page','portfolio'));
    //
    // if(is_admin())
    // {
    // foreach($remove_when as $remove)
    // {
    // if($post_type == $remove || (isset($_GET['post_type']) && $_GET['post_type'] == $remove)) { remove_theme_support( 'post-thumbnails' ); };
    // }
    // }
    //
    // return $msg;
    // }
    }

    #102960

    Hi,

    Has the code you pasted worked as you needed?

    Thanks,

    Nick

    #102961

    Yes. This code works.

    #102962

    Hey!

    Yes, actually following line:

    add_theme_support( 'post-thumbnails' );

    will add the “featured image” option field to the post editor screen.

    Regards,

    Peter

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Can't define "Featured Image". So some othe plugins failed’ is closed to new replies.