i can donate $ so you can buy it 🙂 lol
Thanks man!
Dude you are awesome! Can i buy you a beer?
If i replace background-image:url(<?php echo $use_image; ?>
with either background-image:url(<?php echo $header_image; ?>
or background-image:url(<?php echo $sec_header_image; ?>
it renders the image correctly.
But i want it change it on refresh.
The code is working with the background-position the values are rendering correct but the background-image:url()
is rendering as
background-image:url(1)
and on refresh background-image:url(0)
No clue why, btw i set the return value in ACF to return Image URL
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" >
you know what i did end up doing was registering another ‘category’ and have this act like the organization field – rather than using a custom text field.
Thanks! your input made me rethink what i was doing and what i was trying to achieve. no in-depth custom coding needs to be done.