Tagged: CPT, featured image
In functions.php I find this:
Add a checkbox to the featured image metabox
*/
if(!function_exists(‘avia_theme_featured_image_meta’))
{
add_filter( ‘admin_post_thumbnail_html’, ‘avia_theme_featured_image_meta’);
function avia_theme_featured_image_meta( $content )
{
global $post, $post_type;
if($post_type == “post”)
Is it possible to add custom post types (and how)?
Hi Arjan de Wit!
Yes, you can just remove the $post_type conditional so the checkbox appear in any post type:
if($post_type == "post")
{
...
}
However that will just attach a metadata (_avia_hide_featured_image
) to the post type, you’d then need to use it in the single post type template, like we do it in /includes/loop-index.php:
if(is_single($initial_id) && get_post_meta( $current_post['the_id'], '_avia_hide_featured_image', true ) ) $current_post['slider'] = "";
Best regards,
Josue
Hi Josue,
It works, thanks!
Best regards,
Arjan