Can't upload pictures madness !!! (7 posts)

  1. Rhino666
    Posted 6 years ago #

    I get this message when trying to upload a picture from my pc:

    all to undefined function get_post_thumbnail_id() in /home/www/zoolcome/crazymofo/wp-admin/includes/media.php on line 1255

    So I did a search through the code and found the following:

    Search "get_post_thumbnail_id" (4 hits in 2 files)

    K:\Downloads\wordpress\wp-admin\includes\media.php (1 hits)
    Line 1255: if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id )

    K:\Downloads\wordpress\wp-includes\post-thumbnail-template.php (3 hits)
    Line 23: return !! get_post_thumbnail_id( $post_id );
    Line 34: function get_post_thumbnail_id( $post_id = NULL ) {
    Line 64: $post_thumbnail_id = get_post_thumbnail_id( $post_id );

    Does anyone know how to get round this ?

  2. kmessinger
    Forum Moderator
    Posted 6 years ago #

    A call to an undefined function usually means a file is missing or corrupted. Delete the folder wp-admin and upload a new copy to the server. Do not touch the wp-content folder.

  3. Rhino666
    Posted 6 years ago #

    I had to take copy the piece of code from post-thumbnail-template.php in
    /crazymofo/wp-includes insert into media.php to get it work.

    I shouldn't have to do this to get it to work!!! I wouldn't expect when buying a car to have to fix the engine before I could drive it. Madness!

  4. Rhino666
    Posted 6 years ago #

    The thing is this was a fresh install from scratch with the wordpress 2.9.1 folder being downloaded from wordpress'es site. There's something seriously wrong there.

  5. kmessinger
    Forum Moderator
    Posted 6 years ago #

    Well, you didn't buy anything :^) And you solved the problem :^)

    Madness? We are all crazy for expecting computers and programs to work. We should be outside having fun!

    Seriously though, files do get corrupted when moving them around.

  6. Rhino666
    Posted 6 years ago #

    Can't argue with that.
    What worries me is other people less likely to want to dive into code that have the same problem. I just hope they see this post.

  7. Shane G.
    Posted 6 years ago #


    Check with these options:

    - Upgrade your wordpress version to the latest version. If it already upgraded then reinstall wp-includes and wp-admin directory.
    - Disable all the plugins
    - Assign 755 recursive permissions to wp-content directory.
    - Remove unwanted code from htaccess.


    Shane G.

Topic Closed

This topic has been closed to new replies.

About this Topic