[Resolved] GB Version 1.2.0 no Background Image = Featured Image

Home Forums Support [Resolved] GB Version 1.2.0 no Background Image = Featured Image

Home Forums Support GB Version 1.2.0 no Background Image = Featured Image

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1580629
    Ian

    I may have been developing a recently launched site using a beta or alpha version. I was 100% sure that a Block Element had Background Image = Featured Image. Now, an entire site (hero section) no longer display the featured image as a background. I am using GB Version 1.2.0. Did I miss something?

    #1580796
    Elvin
    Staff
    Customer Support

    Hi,

    I was 100% sure that a Block Element had Background Image = Featured Image.

    Block element doesn’t have that. Perhaps you’re pertaining to Header Element?
    https://docs.generatepress.com/article/header-element-overview/

    Let us know.

    #1580833
    Ian

    Pretty sure this Element I am looking at is not a Block Element. It’s a container with a headline = [PAGE_TITLE] and Type = Block – Hook.

    Regardless, also pretty sure when I launched the client site 1-2 weeks ago, all Hero Sections has a featured image. Client really liked this dynamic way to pull the featured image. Now, there is no more featured image in the container background. I may be missing something here. Where can I troubleshoot this?

    Is it at all possible that something was removed during the last GB update?

    #1580840
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    We removed this feature before the actual release on 1.2.0 – we have something better planned 🙂

    #1580850
    Ian

    Thx Tom. When is the replacement feature coming? Client site is NOT as I had launched it so I may need to fix all pages manually now.

    #1582004
    Tom
    Lead Developer
    Lead Developer

    It’s never recommended to use alpha versions on production websites, as things can change between alpha/beta and official release.

    You can tell the front-end to use the featured image as a background with a filter:

    add_filter( 'generateblocks_background_image_url', function( $url, $settings ) {
        if ( 'unique-id' === $settings['uniqueId'] && has_post_thumbnail() ) {
            return get_the_post_thumbnail_url();
        }
    
        return $url;
    } );

    You just need to update the unique-id with the unique ID of the element. You can find it as an HTML class for the element: .gb-container-unique-id-here

    #1582310
    Ian

    Thanks Tom. Odd, I could not get that snippet to work. I was able to find the unique ID and replaced it inside the functions snippet. Nonetheless, I am going to use a default image for all pages for now. Marking this as resolved.

    #1583358
    Tom
    Lead Developer
    Lead Developer

    Strange, you may need to regenerate the CSS after using the snippet so it uses the correct URL.

    No problem!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.