Archived topic
Disable post images for a specific category only
3 replies · Started by Samuel on November 6, 2020
I use Custom Post Type UI and now I have a new Custom Post Type. The category Overview displays the images in the same way as my blog archive. But I don't want any images in this new Custom Post Type. How can I deactivate it? Unfortunately there is only one general rule in the Customizer.
Hi there,
you can use the option_generate_blog_settings filter:
https://docs.generatepress.com/article/option_generate_blog_settings/
Hi David,
wow very powerful these filters. Thanks!
That works for me:
// /touren-Archivseite individuell gestalten
add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
function lh_custom_search_results_page_settings( $options ) {
if ( is_post_type_archive( $myposttype ) ) {
$options['post_image'] = false;
}
return $options;
}
They certainly are :)
Glad to be of help.