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.

Thumbnail images are not displaying by blog excerpts on my blog at http://richardclunan.com/blog/ -- I found some code that I think I might need to add to functions.php to make this happen, and if I do need to do this, I'd like to know where in functions.php I should add the code...

In my twentyeleven files, in functions.php, it says:

// This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images add_theme_support( 'post-thumbnails' );

But the following code isn't in functions.php:

if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); }

If my understanding of this: http://codex.wordpress.org/Post_Thumbnails is correct, then maybe I have to add that code into functions.php to make thumbnails appear on my blog ...?

Where in the file functions.php would I add the code?

And I presume curly brackets } signify the end of lines of code -- so I guess I'd paste the code after a curly bracket somewhere?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Post thumbnails are enabled in the twenty-eleven theme by default. If it's not working either you have a plugin conflict, or someone has edited the functions.php file. Here is the section of the twenty-eleven functions.php file that should enable the post thumbnails:

add_theme_support( 'post-thumbnails' );

The code needs to be inside the function twentyeleven_setup() function to work.

share|improve this answer
    
I think it's safe to say you don't have to use if ( function_exists( anymore. This was used for backwards compatibility, but shouldn't be an issue in current WordPress versions. –  Jeremy Jared Jan 29 '12 at 18:24
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.