Archived topic
Filter for featured image
3 replies · Started by Amos on February 28, 2018
Hello - Tom maybe you will consider to add filter to the featured image (page-header-image-single)?
right now on every single product page there is feautred image that hide with "display:none"
maybe you will add filter or exclude this post type (product) ?
i cant change it with the child theme because it is on "inc" folder..so every update i need to remove it again... Thank You.
Hi there,
I'm not 100% sure what you are looking for but we do have featured images display/hide options in customizer for Arhchives, Posts and Pages: https://docs.generatepress.com/article/adjusting-the-featured-images/
Would those help?
Let me know :)
i want to change "generatepress/inc/structure/featured-images.php"
from this:
function generate_featured_page_header_inside_single() {
if ( function_exists( 'generate_page_header' ) ) {
return;
}
if ( is_single() ) {
generate_featured_page_header_area( 'page-header-image-single' );
}
}
to this:
function generate_featured_page_header_inside_single() {
if ( function_exists( 'generate_page_header' ) ) {
return;
}
if ( is_singular( $post_types = 'post' ) ) {
generate_featured_page_header_area( 'page-header-image-single' );
}
}
then the featured image display only on "post" post type.
i cant change it from the child theme because it is inside the "inc" folder.. :)
Hi there,
You should be able to do this:
add_action( 'after_setup_theme', 'tu_adjust_single_featured_image' );
function tu_adjust_single_featured_image() {
if ( ! is_singular( 'post' ) ) {
remove_action( 'generate_before_content', 'generate_featured_page_header_inside_single', 10 );
}
}