Archived topic
Custom Post Type description in Archive page
5 replies · Started by Elías Gómez on February 10, 2022
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?

Thanks
Oh I think it is because you fixed the error I posted: https://generatepress.com/forums/topic/modify-archive-description/#post-1932447
So I think the solution is to run remove_action for the post types I don't what it, isn't it?
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!