How do I use a color from theme options?

You would simply call that option inside of a callback, and hook it into wp_print_styles or wp_head (either one is semantically correct in this case). First, set up your callback, which will print an inline style sheet: function wpse74013_print_custom_styles() { ?> <style type=”text/css”> </style> <?php } add_action( ‘wp_head’, ‘wpse74013_print_custom_styles’ ); The next step is to … Read more

Settings API settings section not appearing

The settings API can be puzzling 😉 Replace: do_settings_sections( ‘ia_section_id’ ); with do_settings_sections( ‘srchild’ ); to display your defined settings section. The general usage is: do_settings_sections( $page ); where: $page (string) (required) The slug name of the page whose settings sections you want to output. This should match the page name used in add_settings_section(). Default: … Read more

Change WordPress header color using customizer

You have to inline the css into your theme. CSS is read-only and can’t updated to use the update hex colors for your header. <?php echo get_theme_mod( ‘header_textcolor’ );?> 100%);”> So find the div in your theme called navbar-default and update it to this: <div style=”background:#<?php echo get_theme_mod( ‘header_textcolor’ );?>”> class=”navbar-default”>

Settings API – save multiple tabs at once

Don’t initialize defaults, or do an initial save. Just use sane defaults. For example, define an array of defaults: function wpse92323_get_option_defaults() { $defaults = array( ‘slug1’ => ‘default1’, ‘slug2’ => ‘default2’ ); return apply_filters( ‘wpse92323_option_defaults’, $defaults ); } Then, write a function to return an option value, that parses stored options against your defaults: function … Read more

Option Tree integration of Custom CSS

never* execute code outside of hooks as you are more likely to call a function or use a variable before they were declared and initialized. your code should be function css() { if (ot_get_option(‘css’, false) != false) { echo'<style>’.ot_get_option(‘css’).'</style>’; } } add_action( ‘wp_head’, ‘css’, 100 ); *never say never, but this is a rule to … Read more

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