Support » Fixing WordPress » Not getting the 'Post Thumbnail' option after doing functions.php

  • Hi,

    I’m making a custom theme in 3.1 and want to add thumbnails to my posts on the index. I’ve tried using the functions.php method, but once I’ve done that I do not get the option to add a thumbnail when editing or creating a post.

    Is this method outdated in 3.1 ? If so:

    – How do I add a thumbnail then?
    – How can I style the thumbnail element, if I do not need to call it in index.php anymore ?


Viewing 10 replies - 1 through 10 (of 10 total)
  • What code you write on the functions.php? This is the code which should enable the post thumbnail feature when you placed it on functions.php file.


    I’ve tried various options, but this in my current functions.php

    if ( function_exists('register_sidebars') )
    function kandidaat_init() {
          'label' => __('kandidaat'),
          'rewrite' => array('slug' => 'profiles'),
    add_action( 'init', 'kandidaat_init' ); 
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 200, 200, true ); // Normal post thumbnails
    add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail size

    What I’m using the functions.php for:

    – loading sidebar
    – create one or more taxonomies
    – load thumbnails



    Forum Moderator

    have you tried the ‘screen options’ tab near the top right of the ‘edit post’ page?

    Yes, and it doesn’t give me the option to enable thumbnails. What I can check there is:

    – Categories
    – Post
    – Tags
    – kandidaat (taxonomy)
    – Featured Image
    – WP Calendar Event
    – Excerpt
    – Send Trackbacks
    – Custom Fields
    – Discussion Comments
    – Slug
    – Author
    – Revisions

    Featured image is not the correct one if im right.

    Also I am using the ‘Featured Content Gallery’ plugin, but when deactivating that plugin I still do not get the option “Post Thumbnail”.



    Forum Moderator

    – Featured Image

    it is the correct one to tick
    – there is no difference between ‘featured image’ and thumbnail

    i don’t know about that plugin.

    Thanks for that then 🙂

    Could you tell me how I can style the thumbnail element in CSS? Apparently I do not need to make a seperate PHP line in the index.php, which causes me to not have a seperate div for the thumbs.



    Forum Moderator

    have a look into the html of your post/page in your browser, and locate the area with the thumbnail – there you should be able to see the css classes of the img tag.
    or use a tool such as firebug to check the thumbnail image css class.


    Thanks for that, but I already figured some of it out myself.

    Do you have any idea why WordPress assigns the #main img { } to a thumbnail ? I guess it is a bit of a mix between #main img and .thumb.

    I modified the PHP syntax and renamed the class for thumbnails to “thumb”, but once I add a margin to that class it does not work. Borders however do work?

    Once I edit the #main img div and give that some margin, it works but I can’t see where in the PHP a thumbnail should get that div ?



    Forum Moderator

    this is one of the characteristics of css (Cascading Style Sheets):

    which means that the higher selectors also have an influence on the element – in this case on your img tag.

    it just means that your thumb image is an image img somewhere within an element with the css id #main

    the style for #main img might have a higher priority than a style for .thumb even if .thumb is a direct cssc lass of img

    any formats that are not set in the #main img style can be set by .thumb, but the ones defined alredy probably not.

    to work around this, try and use
    #main img.thumb { ... }
    to style your thumbnail image.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Not getting the 'Post Thumbnail' option after doing functions.php’ is closed to new replies.