- This topic has 7 replies, 3 voices, and was last updated 3 years, 4 months ago by Tom.
-
AuthorPosts
-
December 14, 2020 at 1:06 pm #1580629Ian
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?
December 14, 2020 at 5:46 pm #1580796ElvinStaffCustomer SupportHi,
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.
December 14, 2020 at 6:59 pm #1580833IanPretty 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?
December 14, 2020 at 7:21 pm #1580840TomLead DeveloperLead DeveloperHi there,
We removed this feature before the actual release on 1.2.0 – we have something better planned 🙂
December 14, 2020 at 7:36 pm #1580850IanThx 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.
December 15, 2020 at 12:25 pm #1582004TomLead DeveloperLead DeveloperIt’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
December 15, 2020 at 7:56 pm #1582310IanThanks 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.
December 16, 2020 at 10:27 am #1583358TomLead DeveloperLead DeveloperStrange, you may need to regenerate the CSS after using the snippet so it uses the correct URL.
No problem!
-
AuthorPosts
- You must be logged in to reply to this topic.