Why does get_theme_mod return blank (or default value) but get_option returns saved value?

This is original code from wordpress: function get_theme_mods() { $theme_slug = get_option(‘stylesheet’); $mods = get_option(“theme_mods_$theme_slug”); if (false === $mods) { $theme_name = get_option(‘current_theme’); if (false === $theme_name) $theme_name = wp_get_theme()->get(‘Name’); $mods = get_option(“mods_$theme_name”); // Deprecated location. if (is_admin() && false !== $mods) { update_option(“theme_mods_$theme_slug”, $mods); delete_option(“mods_$theme_name”); } } return $mods; } function get_theme_mods() { $theme_slug … Read more

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)