Archived topic
show featured image depending on the category post
7 replies · Started by Liberty on September 18, 2018
Hello,
I want to customise a bit some category page and i wonder if it's possible to hide/show the featured image depending on the category ?
Thank you for this great theme :)
Hi there,
You can use this filter:
https://docs.generatepress.com/article/option_generate_blog_settings/
So the code would be something like this:
add_filter( 'option_generate_blog_settings', 'lh_hide_category_featured_image' );
function lh_hide_category_featured_image( $options ) {
if ( is_category( 'my-category' ) ) {
$options['post_image'] = true;
}
return $options;
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know :)
Perfect, thank you =)
No problem :)
Leo,
I was browsing the option but i don't find the one that allow the content type to be 'full content' instead of excerpt (http://prntscr.com/kw3p8z).
Is it a mistake on the doc or is this option unavaible ?
Thank you
The excerpt length is actually handled by WordPress itself so it has the WordPress filter instead:
https://docs.generatepress.com/article/generate_show_excerpt/
Let me know if this helps :)
Perfect, thank you again !
No problem :)