Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm new to Wordpress and I'm trying to create a new theme for it. I've downloaded the latest version (3.2.1) and installed it successfuly. But when I install my wordpress theme (to start to add the PHP) and try to create a new post, what happens is that the Set Featured Image box disappears and it only shows again when I return to the default theme.

Any suggestions for this? Thank you

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The most simple form of the featured images (post thumbnails) looks like this:

You need to have this piece of code in your functions.php file:

add_theme_support( 'post-thumbnails' );

Then in the index.php, or any other template file you want to show the post thumb or featured images, you would add this:

<?php the_post_thumbnail( 'thumbnail' ); ?>

The code above usually goes just after <?php the_title(); ?>

Once you've added those, you should see them on posts. To have them on posts and pages, use this in place of the first code for the functions.php file:

add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
share|improve this answer
    
Duplicate Post, Duplicate User? –  Jeremy Jared Sep 24 '11 at 4:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.