WordPress image upload tabs are empty

Just had a bit of an odd issue with a client’s wordpress installation.

When trying to upload an image in to a page, the different tabs were displaying only the column headings and no thumbnails.

Turning on error reporting I saw the following error

PHP Fatal error: Call to undefined function get_post_thumbnail_id()
in wp-admin/includes/media.php on line 1292

To fix this error I added

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

to the functions.php file of the current template and the error went away.

Documentation can be found at http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails

Why it suddenly started doing this I’m not sure. My guess would be a plugin that was installed somewhere along the line caused the issue.

Leave a Reply