Color Options from Theme Customizer API not returning via get_theme_mod()

If your settings are stored as Theme Mods, rather than as a Settings API option, then you need to pass the appropriate value to the type parameter to $wp_customize->add_setting(): ‘option’: Settings API option (get_option()) ‘theme_mod’: Theme Mods API option (get_theme_mod()) Try changing this: $wp_customize->add_setting( $this_theme . ‘_theme_options[‘. $setting .’]’, array( ‘default’ => $param[‘default’], ‘sanitize_callback’ => … Read more

Turn get_posts as string into an array for use in theme admin options

This… array(’54’=>’Post #1′,’23’=>’Post #2′, ‘654’=>’Post #3′,) … is not a string. It is an array definition. All you need to do is create an array, which is what you want, and skip the string completely. function post_page_options(){ $post_page_options = get_posts(‘category=orderby=title&order=asc&numberposts=”); foreach( $post_page_options as $value ) : $str[$value->ID] = $value->post_title; endforeach; return $str; }

Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?

Couple points: The customize_register action hook actually passes your function the $wp_customize variable, you don’t need to declare it as the global. Just put it as the first argument in your function declaration. The reason your code doesn’t run on the front end of the site is that the customize_register action hook only runs when … Read more

Changing the color scheme based on the url visited

The Misconception get_site_url() retrieves the site_url option from the database, as set under General Settings in the administrative backend / wp-admin. If this is indeed the exact same wordpress installation it will always return the same thing, regardless of whether the location is reachable via one, two or five hundred domains. You might want to … Read more

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