Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #392107

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

    #392336

    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

    #392928

    Hi Josue,

    It works, thanks!

    Best regards,
    Arjan

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Featured image checkbox’ is closed to new replies.