DEV Community

loading...

How to add featured image to a new wordpress theme

ravehunter05 profile image Francisco Paul Sotelo Rocha ・1 min read

1) Add featured image setting on functions.php

function theme_post_thumbnails() {
add_theme_support( 'post-thumbnails' );
}

add_action( 'after_setup_theme', 'theme_post_thumbnails' );

2) Add the feature image to your post

Featured image

3) Add the image to your single posts

Here you have to go to single.php, or create that file in the case that you don't have it, and here write something like this:

Code post

4) Now go to your post, and... thats all!

Post result

Sayonara

Discussion (0)

pic
Editor guide