Theme customizer: How do you grab the value later?

I made one change… $wp_customize->add_setting( // ID ‘primm_slider_speed’, // Arguments array array( ‘default’ => ‘5000’, ‘type’ => ‘theme_mod’ <– made change right here. ) ); ‘type’ = ‘option’ just didn’t work. ‘type’ = ‘theme_mod’ totally nailed it. Option set manually to 6200, hit save. Refresh home page. Output now: Slider Timing: 6200string(4) “6200” Big Ouch… … Read more

Use default value of wp_customizer in theme_mod output?

Sadly not – all your customize controls are hooked onto customize_register, so they’ll only ever come into play when customising the theme for the first time. get_theme_mod() takes a second argument for a “default” value – yes, it means two instances of data in your code, but it’s a half-solution. I guess a more DRY … Read more

get_option() vs get_theme_mod(): Why is one slower?

The answer that yes, the theme_mod functions will be slower, but not significantly, and the benefits outweigh the differences. Theme mods are stored as options. So, in essence, the theme_mod functions are wrappers around the options functions. First, understand that theme_mod settings are stored as an array in a single option, keyed to the specific … Read more