Hey guys!
This is driving me insane and I've done this dozens of times before and I know it's simple, but I can't seem to figure it out
I have the following piece of code in my WordPress theme set right now that when I add a custom background image to a post, it overrides the set custom image for the home page and rest of the site.
I need to fix it so that when I can set a background custom image for each post and it doesn't override any other set custom backgrounds.
Here's the code:
/* Add a custom bg if it exists */
<?php $homepage_bg = get_option_tree("default_bg");
if(get_custom_field('custom_background_image')) { ?>
body {background: url('<?php echo get_custom_field('custom_background_image',true); ?>') top left fixed repeat;}
<?php } elseif (isset($homepage_bg[0])) { ?>
body {background: url('<?php echo get_option_tree("default_bg"); ?>') top left fixed repeat;}
<?php } else {} ?>
<?php global $theme_options; ?>
Any thoughts?
Thanks to everyone in advance!