Created
June 1, 2023 04:08
-
-
Save chekle/e653a9370c6b9db001c4c3c80d4fbf0f to your computer and use it in GitHub Desktop.
Background images using - ACF / CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
style="background-image:url('<?php $image = get_sub_field('image'); $size = 'full'; if( $image ) { echo wp_get_attachment_image_url( $image, $size ); } ?>');" | |
style="background-image: linear-gradient(269.77deg, rgba(0, 0, 0, 0.2) 2.1%, rgba(0, 0, 0, 0.6) 100%), url(<?php $image = get_sub_field('background_image'); $size = 'full'; if( $image ) { echo wp_get_attachment_image_url( $image, $size ); } ?>);" | |
/* Background Images CSS */ | |
background-image:url(images/image.jpg); | |
background-repeat: no-repeat; | |
background-size:cover; | |
background-position:center; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment