Enabling Featured Images

If you don't see a Featured Image box on your Edit Posts screen, you can enable one by adding the code in Listing 6-34 to your functions.php file. Featured images were known as post thumbnails prior to version 3.0, and the theme functions still use the old terminology.

Listing 6-34. Enabling featured images add_theme_support( 'post-thumbnails' );

Featured Image



Remove featured image

Figure 6-17. The featured image meta box in the Post Edit screen

This will make the box shown in Figure 6-17 appear. It will also enable you to add thumbnails to your post, but the thumbnails won't actually appear on your site until you've edited your other theme files. Find the spot where you'd like the images to appear and add the code in Listing 6-35.

Listing 6-35. Using the featured image in a template

0 0

Post a comment