Site logo

Archived topic

Function to remove entry-header and featured-image

5 replies · Started by Fabien on April 29, 2020

Viewing posts 1–6 of 6

Hi,

Is there a function to remove the header (cf. entry header) fully and the featured image ?

Thanks

Hi there,

Just to confirm, so basically you only want to use the excerpt on the posts/archive pages?

Nope ;-)

I just want to remove/hide the post title and the thumbnail of my CPT by using a php function and not elements.

Would this be on single posts or in the archive?

Hi Tom,

Single post !

Give this a shot:

add_filter( 'generate_show_title', function( $show ) {
    if ( is_singular( 'your-post-type' ) ) {
        return false;
    }

    return $show;
} );

For the featured image, any chance you can link me to one of the posts?

This archived topic is closed to new replies.