Viewing 1 post (of 1 total)
  • Author
    Posts
  • #19276

    Hello Everyone,

    In WordPress 3.5 the in-editor support for Set as Featured Image was changed to appear in the ‘Add Media’ editor. If you need to control exactly which image is set to the Featured Image for other plugins you can follow these steps:

    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 ~325-348.

    What this does is comment out that function so it no longer takes effect. You should now see “Set Featured Image” in the image window after clicking on Add Media.

    Regards,

    Devin

Viewing 1 post (of 1 total)

The topic ‘How to get "Set Featured Image" in WordPress 3.5’ is closed to new replies.