• I wish to install the Post Thumbnail option. What I’ve picked up on various Forums is that before I can see it in the write post page I have to past some code into my functions.php file – add_theme_support(‘post-thumbnails’); – is that correct?

    My question is a rather elementary one. Where does the line go? Here is the last few lines of my custom.php file but I don’t know how to add it. I would appreciate some advice.

    case 2 :
    case 3 :
    case 4 :
    case 5 :
    case 6 :
    return “WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )”;
    }
    }

    ?>

    It would be nice if there was a plug-in that would do all of this for me ??

    Thanks

    Kevin

Viewing 9 replies - 1 through 9 (of 9 total)
  • Add this at the very end of the file. Be VERY careful not to leave any blank lines between the existing final >? and the new line. Also, do not leave an extra empty line after this one or you will get the ‘Cannot modify header … ‘ error.

    <?php add_theme_support('post-thumbnails'); ?>

    Thread Starter kah22

    (@kah22)

    vtxzzy thanks for your answer, but I’m having trouble, here’s where I’m at:
    original code:
    return “WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )”;
    }
    }

    ?>

    added:
    <?php add_theme_support(‘post-thumbnails’); ?>

    new code:
    return “WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )”;
    }
    }

    ?>
    <?php add_theme_support(‘post-thumbnails’); ?>

    been VERY, VERY careful not to leave any space between ?> and additional code. No white space at end either.

    Getting the following error
    Fatal error: Call to undefined function the_post_thumbnail() in /websites/LinuxPackage04/ba/bi/es/my-domain.com/public_html/wp-includes/functions.php on line 4300

    What version of WP are you running?

    Thread Starter kah22

    (@kah22)

    3.0.1

    The message has nothing to do with extra lines or spaces, so that looks OK. The version of WP is right.

    Check if you have the file wp-includes/post-thumbnail-template.php.

    Thread Starter kah22

    (@kah22)

    Yes, wp-includes/post-thumbnail-template.php is there

    I’m running out of things to check. I guess it is possible that the add_theme_support line needs to be higher up in the functions.php, but I have not run into that before.

    In order to know exactly how to put it in, please post the first 20 lines or so of your functions.php. Be sure to enclose the lines in backticks.

    Thread Starter kah22

    (@kah22)

    Thanks for your support vtxyzzy

    This was a premium theme (Thesis) that I was working with and I posed the same question there. The answer that came back said to change the custom-function.php file NOT the WordPress function.php file and add

    <?php add_theme_support('post-thumbnails'); ?>
    add_theme_support('post-thumbnails');

    again I got an error message but decided to try single lines and when I put add_theme_support('post-thumbnails'); in on its own the plugin seem to be satisfied.

    Again many thanks for your help. Hopefully you advice and this will help other WordPressers!

    Glad you got it to work. Now, please use the dropdown at top right to mark this topic ‘Resolved’ so anyone searching for this problem will see that there is a solution.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Simple php question’ is closed to new replies.