0

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?

1

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.

| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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