Using featured img as div background
Try something like this: <?php global $post; $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, ” ); $default = get_template_directory_uri().”/assets/images/backgrounds/highway.jpg”; $bgimg = (isset($src[1])) ? $src[0] : $default; ?> <style type=”text/css”> .parallax { background-image: url(<?= $bgimg ?>); } </style> wp_get_attachment_image_src() says it returns false when not found, but for some reason I’ve had bad time with … Read more