Site logo

Archived topic

Custom Post Type description in Archive page

5 replies · Started by Elías Gómez on February 10, 2022

Viewing posts 1–6 of 6

Hi, I have several CPT and now it is showing the CPT description in the Archive page, but that was not happening before. ¿Why is happening? ¿How can I hide or disable it?

Description in archive page

Thanks

I filtered the description, now that I can. This is the snippet:

add_filter( 'get_the_archive_description', 'eg_disable_post_type_archive_description', $priority = 10, $accepted_args = 1 );
function eg_disable_post_type_archive_description($description){
    if (is_post_type_archive()) {
        return '';
    }
    return $description;
}

Hi there,

is that working for you now ? Looks good to me :)

Yes it works.

Glad to hear that!

This archived topic is closed to new replies.