public
Last active

get_theme_mod

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<!-- in footer.php -->
<div class="footer-text"><?php echo get_theme_mod('footer_text') ?></div>
 
<!-- rendered HTML content -->
<div class="footer-text">&copy;2012 Site Name</div>
 
<!--in functions.php (to enable the field in the Theme Customizer) -->
 
<?php
 
$wp_customize->add_section( 'footer', array(
'title' => 'Footer',
'priority' => 105,
) );
 
$wp_customize->add_setting( 'footer_text', array(
'default' => '',
) );
 
$wp_customize->add_control( 'footer_text', array(
'label' => 'Footer Tagline',
'section' => 'footer',
'type' => 'text',
) );

I posted this as part of a support forum ticket on WP.org, but I figured someone else might find it useful. Enjoy!

Awesome - thanks for this Clark

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.