Home › Forums › General Issues › Show one image or the other Image › Reply To: Show one image or the other Image
What if i want to change the images on refresh..
I am doing the following
<div style="background-image:url(<?php
if(get_field('header_banner_image') != '') {
echo get_field('header_banner_image');
} elseif($default_page_options['banner_image']) {
$url_array = parse_url($default_page_options['banner_image']);
echo get_site_url() . $url_array['path'];
} else {
echo get_site_url() . '/wp-content/themes/neo/images/bg-header.jpg';
}
?>); background-position: <?php
echo get_field('header_banner_position_x'); ?> <?php
echo get_field('header_banner_position_y'); ?>;" class="page-header-ban-img" >
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.