[Support request] Filter for featured image

Home Forums Support [Support request] Filter for featured image

Home Forums Support Filter for featured image

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #508049
    Amos

    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.

    GeneratePress 2.0.2
    #508231
    Leo
    Staff
    Customer Support

    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 ๐Ÿ™‚

    #508377
    Amos

    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.. ๐Ÿ™‚

    #508559
    Tom
    Lead Developer
    Lead Developer

    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 );
        }
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.