WordPress.org

Support

Support » How-To and Troubleshooting » Customizer and Call all Options question

Customizer and Call all Options question

  • I am now wanting to advance by using this in the header of my new theme to call all theme options:
    <?php $options = get_theme_mods(); ?>

    Then for option settings through my theme, such as custom colours, I use this:

    <?php $options['topbg'] ?>

    But, how do I add a default value to the above code. Before I was doing this:

    <?php echo get_theme_mod( 'topbg', '#ffffff' ); ?>

    I was trying to avoid getting multiple “get_theme_mods” throughout my theme, but if I cannot get the default values in, I will have to use the latter method instead. Thanks in advance.

  • The topic ‘Customizer and Call all Options question’ is closed to new replies.