Set default theme flavour in theme options
-
I’m trying to update one of my old themes (Stripay) which came out before the customizer.
It uses a theme option section and when you first installed the theme, the mustard style was selected by default.
Now it no longer does this and I’m not sure what’s changed.Here’s part of my code. Does anything jump at you that I should change?
function stripay_get_default_theme_options() { $default_theme_options = array( 'stripay_theme_style' => 'mustard' ); return apply_filters( 'stripay_default_theme_options', $default_theme_options ); } function stripay_get_theme_options() { return get_option( 'stripay_theme_options', stripay_get_default_theme_options() ); } function stripay_settings_field_theme_style() { $options = stripay_get_theme_options(); foreach ( stripay_theme_style() as $button ) { ?> <div class="layout"> <label class="description"> <img src="<?php echo get_template_directory_uri() ?>/images/ss/<?php echo $button['value']; ?>.png" alt="<?php echo $button['label']; ?> Style" /><br /> <input type="radio" name="stripay_theme_options[theme_style]" value="<?php echo esc_attr( $button['value'] ); ?>" <?php checked( $options['theme_style'], $button['value'] ); ?> /> <?php echo $button['label']; ?> </label> </div> <?php } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Set default theme flavour in theme options’ is closed to new replies.