0
I have a CSS that is like this:
.cid-rlWhG48NmK {
padding-top: 60px;
padding-bottom: 0px;
background-image: url("../../images/background4.jpg");
}
And my HTML calls it this way:
<section class="mbr-section content5 cid-rlWhG48NmK mbr-parallax-background" id="content5-f">
...
I want to implement the get_the_post_thumbnail()
in the cid-rlWhG48NmK
changing the image: If you have a highlighted image, then use a pattern otherwise.
I’m trying this way:
<style>
<?php if(get_the_post_thumbnail()) : ?>
.cid-rlWhG48NmK {
background-image: url('<?php the_post_thumbnail(); ?>')>;
}
<?php else : ?>
.cid-rlWhG48NmK {
background-image: url('<?php bloginfo($show = ´template_url´); ?>/assets/images/background4.jpg');
}
<?php endif; ?>
</style>
<section class="mbr-section content5 cid-rlWhG48NmK mbr-parallax-background" id="content5-f">
But it’s not taking either the highlighted image or the defined image otherwise.
Does anyone know how to solve?
PS: I remove the background-image from CSS to make the code I want.
Glaydson Rodrigues, it worked out! Thank you very much! :)
– Ramos