I've been working on this for a while and even though i've searched through a lot of stackoverflow questions/answers, i haven't been able to find what i'm looking for.
My question:
I'm working on developing my first genesis wordpress child theme, particularly now the customizer. I want the user to be able to have different options, one of which is choosing from a few background patterns that I've designed for a certain div class. There are three different patterns, and I've been able to so far make three radio buttons. Here is the code:
$wp_customize->add_setting('BG_Pattern', array( 'default' => '#f5ebdf',));
$wp_customize->add_control('BG_Pattern', array(
'label' => __('Background Pattern', 'FoxiePro'),
'section' => 'backgrounds',
'settings' => 'BG_Pattern',
'type' => 'radio',
'choices' => array(
'tan.jpg' => 'Tan',
'#e6e6e6' => 'gray',
'teal' => 'teal',
),
));
And the output is this, in the header.php file:
<?php
$BG_Pattern = get_theme_mod('BG_Pattern');
?>
<style>
.enews-widget {background-image: url( '<?php echo $BG_Pattern; ?>' );}
</style>
Where it says "tan.jpg", is where I would like to put in a url to tan.jpg src, which is in my child theme folder. However, any link I put in doesn't make the pattern appear. Inputting something like:
'bloginfo('template_url'); ?>/images/tan.jpg' => 'Tan',
also hasn't worked for me. Anyone have any ideas? Thanks!
</div>