How to add background-image with URL per post without dirty style to div
-
Hello guys,
I need create a post format where each post has a featured image as background, but without adding dirty styling to a div like this:
‘<div style=”background-image: URL (url)></div>’
I need to do it like WordPress.com does it: https://en.blog.wordpress.com/2014/10/28/photography-101-course/for example:
‘<div class=”image”></div>’
And on CSS should look like this:
‘.image {background-image: url(the url)}’Does anyone knows how WordPress manages to do that?
Thanks,
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to add background-image with URL per post without dirty style to div’ is closed to new replies.