WordPress.org

Support

Support » How-To and Troubleshooting » Can’t upload pictures madness !!!

Can’t upload pictures madness !!!

  • 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 ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • kmessinger
    Forum Moderator

    @kmessinger

    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.

    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!

    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.

    kmessinger
    Forum Moderator

    @kmessinger

    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.

    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.

    Shane G.
    Member

    @shane-g-1

    Hi,

    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.

    Thanks,

    Shane G.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can’t upload pictures madness !!!’ is closed to new replies.