I’d like to add a Featured image to a default article or a Custom Type Post in my theme but I don’t get the area of the highlight image, why? In the default theme the option is present but not in my theme, what have I missed?
Leave a Reply
You must be logged in to post a comment.
You need to add theme support in the
functions.php
file of your active theme like this:To enable it within a custom post type, you will need to do so when registering your post type with the
supports
argument, so you’ll need to add something to your already existing code that registers your post type like so (this is an example):If you see the last line of the
$args
array, there’sthumbnail
in thesupports
array. That enables it for the custom post type.See the Codex for more information:
For adding thumbnail support: http://codex.wordpress.org/Post_Thumbnails
For registering post types: http://codex.wordpress.org/Function_Reference/register_post_type
Or more specifically, a complete example with thumbnails added to a custom post type is here:
http://codex.wordpress.org/index.php?title=Function_Reference/register_post_type&oldid=112358#Example