How can I add a set featured image function to a theme that doesn’t already have it built in?

You can add this line to your functions.php file to add the post thumbnail option to all post types:

add_theme_support( 'post-thumbnails' ); 

If you want it for only one post type, you pass an array of post type names as second argument:

add_theme_support( 'post-thumbnails', array( 'post' ) ); #shown in posts only

To display the thumbnail in your template files:

if ( has_post_thumbnail() ) {
    the_post_thumbnail();
} 

Read about Post Thumbails and add_theme_support().

Leave a Comment