Archived topic
Dynamic background "Featured Image" not showing
3 replies · Started by piet on May 3, 2021
Hi,
on my site I'm trying to accomplish the display of a post's featured image as background for a site hero banner, which I've set up as an element.
Example: https://www.velovolt.de/e-bike/sachsen/dresden/mietstation-dresden-am-hauptbahnhof/
I'm using a plugin that creates the content as custom post type.
As per their documentation, the first image of a post is set as "featured image"
https://wpgeodirectory.com/docs-v2/design/images/
- I played around a little bit with the image settings in the customizer for the "Blog" module but couldn't get the background to show the featured image.
- I also set the block's "remove container condition" to "No featured image" to make sure that the featured image was available. The page hero kept showing for posts with images why I guess the featured image is there in the data model, but still it isn't used to create the dynamic background.
What am I missing?
Hi there,
looks like that plugin is using its own custom function to replace the WP featured image - theres a chance that they are storing the image in the Post Meta - can you check with the plugin developer if there is Meta Key (Name) that can be used with the get_post_meta function
In the meantime try setting the background image dynamic option to Post Meta - and try the: featured_image as the post meta name... just a shot in the dark.
Hi David,
thanks a lot for the quick reply and the attempt to help.
I also contacted the plugin's dev support and they claimed to use the standard featured image indeed.
I was able to solve the riddle now. The problem was not the meta key, but the hook I used.
Apparently, the featured image wasn't available "after_header" where I firstly set the placement of my element.
It started to work once I changed it to "before_content". :)
Thanks again for your quick and supportive reply and have a great day.
Glad to hear you found the issue!