WP Customizer on a webserver not changing the CSS - php

I created my own theme in WordPress in which users are able to set a custom background-color.
When running locally on XAMPP, I have no problem, but when I upload the theme to a web server the background color disappears. When I go into the Customizer tab the background color is correct. The WordPress on the webserver is a fresh install.
It seems like this line is responsible for the missing color:
<?php echo get_theme_mod('info_bg_color'); ?>
How it looks on a webserver where the header and footer should be green.
(Picture)
When I open the customizer tab the colors are correct.
(Picture)
This is just a part of the code.
Please contact me for the full site.
Can anyone help me?
/*
================================
Customize Appearance Options
================================
*/
function info_customize_register( $wp_customize ){
// Add setting
$wp_customize->add_setting('info_txt_color', array(
'default' => '#FFF',
'transport' => 'refresh',
));
$wp_customize->add_setting('info_bg_color', array(
'default' => '#287e43',
'transport' => 'refresh',
));
$wp_customize->add_setting('info_border_color', array(
'default' => '#ba2e25',
'transport' => 'refresh',
));
$wp_customize->add_setting( 'info_logo' );
$wp_customize->add_setting('text_setting', array(
'default' => 'Logo',
));
// Add section
$wp_customize->add_section('info_colors',array(
'title' => __('Farver','info'),
'priority' => 30,
));
$wp_customize->add_section('info_header_logo',array(
'title' => __('Logo','info'),
'priority' => 30,
'description' => 'Upload et logo som vil erstatte "Logo" teksten i din header',
));
$wp_customize->add_section('footer_settings_section', array(
'title' => 'Footer Text Section'
));
// Add control
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'info_txt_color_control', array(
'label' => __('Tekst Farve','info'),
'section' => 'info_colors',
'settings' => 'info_txt_color',
)));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'info_bg_color_control', array(
'label' => __('Baggrunds Farve','info'),
'section' => 'info_colors',
'settings' => 'info_bg_color',
)));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'info_border_color_control', array(
'label' => __('Border Farve','info'),
'section' => 'info_colors',
'settings' => 'info_border_color',
)));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'info_logo_control', array(
'label' => __( 'Logo', 'info' ),
'section' => 'info_header_logo',
'settings' => 'info_logo',
)));
$wp_customize->add_control('text_setting', array(
'label' => 'Logo Tekst',
'section' => 'info_header_logo',
'type' => 'textarea',
));
}
add_action( 'customize_register' , 'info_customize_register' );
/*
================================
Customize Appearance Options
================================
*/
function info_customize_css() { ?>
<style type="text/css">
header p, #digital-time {
color: <?php echo get_theme_mod('info_txt_color'); ?>;
}
header {
background-color: <?php echo get_theme_mod('info_bg_color'); ?>;
border-bottom: 4px solid <?php echo get_theme_mod('info_border_color'); ?>;
}
footer {
background-color: <?php echo get_theme_mod('info_bg_color'); ?>;
border-top: 4px solid <?php echo get_theme_mod('info_border_color'); ?>;
}
</style>
<?php }
add_action( 'wp_head' , 'info_customize_css' );

Related

Customize.php in wordpress

first I want to apologize for my bad English! I've been developing Wordpress theme for some time, but I have a strange problem with WP_Customize_Control. When I install the theme on a fresh Wordpress installation, the colors of theme are not quite right and custom footer text also .. like the file /customizer.php/ is missing but he isn`t.. When I inspect the code I see the following code:
<style type="text/css">
#sbi_mod_error{ display: block; }
</style>
<style type="text/css">
.site-header nav ul li.current-menu-item a:link,
.site-header nav ul li.current-menu-item a:visited,
.site-header nav ul li.current-page-ancestor a:link,
.site-header nav ul li.current-page-ancestor a:visited {
background-color: ;
}
.date-new,
.btn-primary,
.btn-primary-a,
.btn-primary-a:link,
.btn-primary-a:visited,
div.hd-search #searchsubmit {
background-color: ;
}
footer {
background: ;
}
.btn-primary:hover,
div.hd-search #searchsubmit:hover {
background-color: ;
}
.navbar,
.dropdown-menu {
background-color: ;
}
.widget-title,
.cat>a {
border-bottom: ;
}
.read-more {
border: 1px solid ;
}
.widget ul li::before {
color: ;
}
body {
background: ;
}
</style>
<style type="text/css">.recentcomments a{display:inline
!important;padding:0 !important;margin:0 !important
</style>
<style type="text/css" media="print">#wpadminbar { display:none; }</style>
<style type="text/css" media="screen">
html { margin-top: 32px !important; }
* html body { margin-top: 32px !important; }
#media screen and ( max-width: 782px ) {
html { margin-top: 46px !important; }
* html body { margin-top: 46px !important; }
}
</style>
when I go to "Customize", make changes and save it, everything is done. would some help me? It is my customize.php file:
<?php
// Customize Appearance Options
function Clean_Blog_Customize_Register( $wp_customize ) {
$wp_customize->add_setting('lwp_link_color', array(
'default' => '#000',
'transport' => 'refresh',
));
$wp_customize->add_setting('lwp_btn_color', array(
'default' => '#007bff',
'transport' => 'refresh',
));
$wp_customize->add_setting('lwp_nav_color', array(
'default' => '#262626',
'transport' => 'refresh',
));
$wp_customize->add_setting('lwp_btn_hover_color', array(
'default' => '#49a1ff',
'transport' => 'refresh',
));
$wp_customize->add_setting('lwp_footer_color', array(
'default' => '#1a1a1a',
'transport' => 'refresh',
));
$wp_customize->add_setting('lwp_borders_color', array(
'default' => '#007bff',
'transport' => 'refresh',
));
$wp_customize->add_setting('lwp_background_color', array(
'default' => '#f2f2f2',
'transport' => 'refresh',
));
$wp_customize->add_section('lwp_standard_colors', array(
'title' => __('Standard Colors', 'CleanBlog'),
'priority' => 30,
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_link_color_control', array(
'label' => __('Link Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_link_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_btn_color_control', array(
'label' => __('Button Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_btn_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_btn_hover_color_control', array(
'label' => __('Button Hover Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_btn_hover_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_nav_color', array(
'label' => __('Navigation Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_nav_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_footer_color', array(
'label' => __('Footer Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_footer_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_borders_color', array(
'label' => __('Bordes Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_borders_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,
'lwp_background_color', array(
'label' => __('Background Color', 'CleanBlog'),
'section' => 'lwp_standard_colors',
'settings' => 'lwp_background_color',
) ) );
// Add a footer/copyright information section.
$wp_customize->add_panel( 'text_blocks', array(
'priority' => 500,
'theme_supports' => '',
'title' => __('Text Blocks', 'CleanBlog'),
'description' => __( 'Set editable text for certain content.', 'CleanBlog'
),
) );
$wp_customize->add_section( 'custom_footer_text' , array(
'title' => __('Change Footer Text','CleanBlog'),
'panel' => 'text_blocks',
'priority' => 10
) );
// Add setting
$wp_customize->add_setting( 'footer_text_block', array(
'default' => __( 'default text', 'CleanBlog' ),
'sanitize_callback' => 'sanitize_text'
) );
// Add control
$wp_customize->add_control( new WP_Customize_Control( $wp_customize,
'custom_footer_text', array(
'label' => __( 'Footer Text', 'CleanBlog' ),
'section' => 'custom_footer_text',
'settings' => 'footer_text_block',
'type' => 'text'
)));
// End Adding a footer/copyright information section.
$wp_customize->add_panel( 'panel_id', array(
'priority' => 2,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Social Media Links', 'textdomain' ),
'description' => __( 'Description of what this panel does.', 'textdomain'
),
) );
//Facebook
$wp_customize->add_section( 'section_id', array(
'priority' => 10,
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => __( 'Social Links', 'textdomain' ),
'description' => '',
'panel' => 'panel_id',
) );
$wp_customize->add_setting( 'facebook_link', array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => '',
'sanitize_callback' => 'esc_url',
) );
$wp_customize->add_control( 'facebook_link', array(
'type' => 'url',
'priority' => 10,
'section' => 'section_id',
'label' => __( 'Facebook URL', 'textdomain' ),
'description' => '',
) );
//Twitter
$wp_customize->add_setting( 'twitter_link', array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => '',
'sanitize_callback' => 'esc_url',
) );
$wp_customize->add_control( 'twitter_link', array(
'type' => 'url',
'priority' => 10,
'section' => 'section_id',
'label' => __( 'Twitter URL', 'textdomain' ),
'description' => '',
) );
//YouTube
$wp_customize->add_setting( 'youtube_link', array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => '',
'sanitize_callback' => 'esc_url',
) );
$wp_customize->add_control( 'youtube_link', array(
'type' => 'url',
'priority' => 10,
'section' => 'section_id',
'label' => __( 'YouTube URL', 'textdomain' ),
'description' => '',
) );
//Linkedin
$wp_customize->add_setting( 'linkedin_link', array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => '',
'sanitize_callback' => 'esc_url',
) );
$wp_customize->add_control( 'linkedin_link', array(
'type' => 'url',
'priority' => 10,
'section' => 'section_id',
'label' => __( 'Linkedin URL', 'textdomain' ),
'description' => '',
) );
//google_plus
$wp_customize->add_setting( 'google_plus_link', array(
'default' => '',
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'transport' => '',
'sanitize_callback' => 'esc_url',
) );
$wp_customize->add_control( 'google_plus_link', array(
'type' => 'url',
'priority' => 10,
'section' => 'section_id',
'label' => __( 'Google Plus URL', 'textdomain' ),
'description' => '',
) );
}
// Sanitize text
function sanitize_text( $text ) {
return sanitize_text_field( $text );
}
add_action('customize_register', 'Clean_Blog_Customize_Register');
// Output Customize CSS
function Clean_Blog_Customize_Css()
{
?>
<style type="text/css">
.site-header nav ul li.current-menu-item a:link,
.site-header nav ul li.current-menu-item a:visited,
.site-header nav ul li.current-page-ancestor a:link,
.site-header nav ul li.current-page-ancestor a:visited {
background-color: <?php echo get_theme_mod('lwp_link_color'); ?>;
}
.date-new,
.btn-primary,
.btn-primary-a,
.btn-primary-a:link,
.btn-primary-a:visited,
div.hd-search #searchsubmit {
background-color: <?php echo get_theme_mod('lwp_btn_color'); ?>;
}
footer {
background: <?php echo get_theme_mod('lwp_footer_color'); ?>;
}
.btn-primary:hover,
div.hd-search #searchsubmit:hover {
background-color: <?php echo get_theme_mod('lwp_btn_hover_color'); ?>;
}
.navbar,
.dropdown-menu {
background-color: <?php echo get_theme_mod('lwp_nav_color'); ?>;
}
.widget-title,
.cat>a {
border-bottom: 1px solid <?php echo
get_theme_mod('lwp_borders_color'); ?>;
}
.read-more {
border: 1px solid <?php echo get_theme_mod('lwp_borders_color'); ?>;
}
.widget ul li::before {
color: <?php echo get_theme_mod('lwp_borders_color'); ?>;
}
body {
background: <?php echo get_theme_mod('lwp_background_color'); ?>;
}
</style>
<?php
}
add_action('wp_head', 'Clean_Blog_Customize_Css');
theme option default background-color set used code
background-color: <?php echo get_theme_mod('lwp_link_color','#b71757'); ?>;

Adding a customized section in wordpress menu using wp_customize to select images

I have the following function in my function.php file;
function customize_images($wp_customize){
$wp_customize->add_section( 'customize_images_save', array(
'title' => __('Custom Image', 'themename'),
'description' => 'Select Image',
'priority' => 120,
));
$wp_customize->add_setting( 'image_option', array(
'default' => 'image.jpg',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'image_option', array(
'label' => __('Select Image', 'themename'),
'description' => '',
'section' => 'customize_images_save',
'priority' => 10,
'settings' => 'image_option',
)));
}
which is supposed to add a custom section in my WordPress customize menu.
Then the following codes to display the image in my home-page.php file;
<?php
$my_image_top = get_theme_mod( 'image_option', 'default.jpg' );
$image_top = wp_get_attachment_image_src( $my_image_top , 'full' );
?>
<img src="<?php echo $image_top ?>">
Unfortunately it's not displaying anything and it's just returning a blank <img src"">. I've been struggling to find the error, any help?
Found the issue, here's the correction in $wp_customize->add_setting.
Here's the setting reference from WordPress Codex;
<?php add_settings_field( $id, $title, $callback, $page, $section, $args ); ?>
Wrong Argument Old Code;
$wp_customize->add_setting( 'image_option', array(
'default' => 'image.jpg',
'capability' => 'edit_theme_options',
'type' => 'option',
));
I was having the image selector 'type' => 'option' as an option.
Here's the edited Code which fix this matter:
$wp_customize->add_setting( 'image_option', array(
'default' => 'image.jpg',
));
I hope it help someone in the future. More information about the $wp_customize->add_setting Usage here: WordPress Function Reference/add settings field

wordpress customizer get_theme_mod no output

i am working on a theme for wordpress right now to see how it works etc. But now i want to implement some customizer settings/controls. So here is what i tried
function myfirsttheme_customizer_register($wp_customize){
$wp_customize->add_section('mycustomtheme_colors', array(
'title' => __('Colors','mycustomtheme'),
'description' => 'Modify the theme colors'
));
$wp_customize->add_setting('background_color', array(
'default' => '#fff',
));
$wp_customize->add_setting('link_color', array(
'default' => '#4b4b4',
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
'label' => __('Edit Background Color', 'mycustomtheme'),
'section' => 'mycustomtheme_colors',
'settings' => 'background_color'
) ));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link-color', array(
'label' => __('Edit Link Color', 'mycustomtheme'),
'section' => 'mycustomtheme_colors',
'settings' => 'link_color'
) ));
}
add_action('wp_head','mycustomtheme_css_customizer');
add_action('customize_register','myfirsttheme_customizer_register');
and the HTML/CSS here
function mycustomtheme_css_customizer(){
?>
<style type="text/css">
article { background-color:<?php echo get_theme_mod('background_color');?> ; }
</style>
<?php
}
So when i change the line echo get_theme_mod('background_color'); with an actual color like #fff it works fine, but for some reason the get_theme_mod doesn't give an output and i can't understand why not.
add these line in your setting array
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
following code will work
function myfirsttheme_customizer_register($wp_customize){
$wp_customize->add_section('mycustomtheme_colors', array(
'title' => __('Colors','mycustomtheme'),
'description' => 'Modify the theme colors'
));
$wp_customize->add_setting('background_color', array(
'default' => '#fff',
'type' => 'theme_mod',
'capability' => 'edit_theme_options'
));
$wp_customize->add_setting('link_color', array(
'default' => '#4b4b4',
'type' => 'theme_mod',
'capability' => 'edit_theme_options'
));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
'label' => __('Edit Background Color', 'mycustomtheme'),
'section' => 'mycustomtheme_colors',
'settings' => 'background_color'
) ));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link-color', array(
'label' => __('Edit Link Color', 'mycustomtheme'),
'section' => 'mycustomtheme_colors',
'settings' => 'link_color'
) ));
}
add_action('customize_register','myfirsttheme_customizer_register');

wordpress customizer default settings not working

I'm working on my first theme for wordpress and I am running in to some problems.
I was busy building a customizer page for the theme.
It went great up until the customizer wouldn't parse the default settings to the css.
I've tried building the functions file all over again but nothing worked.
Could you guys take a look t the code and tell me if there is anything wrong, or if anyone else had this problem tell me what the solution is.
here is the code of my funtions.php file
<?php
add_theme_support( 'menus' );
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'header-menu' => 'main'
)
);
}
add_action( 'init', 'register_my_menus' );
add_theme_support( 'post-thumbnails' );
function claboxico_customize_register( $wp_customize ) {
//fonts array
$googlefonts = array(
'arial'=>'Arial',
'verdana'=>'Verdana, Geneva',
'trebuchet'=>'Trebuchet',
'trebuchet ms'=>'Trebuchet MS',
//this list contains way more fonts
);
//general panel
$wp_customize->add_panel( 'colors', array(
'title' => __( 'Colors' ),
'description' => 'Edit the general styling',
) );
//general colors section
$wp_customize->add_section('primairy_color', array(
'title' => __('Primairy Colors', 'claboxico'),
'panel' => 'colors',
'description' => 'Edit the primairy color of the theme.'
));
//primairy color setting
$wp_customize->add_setting('primairy_color', array(
'default' => '#43bfd8',
));
//primairy color control
$wp_customize->add_control( new WP_Customize_Color_control( $wp_customize, 'primairy_color', array(
'label' => __('Primairy Color', 'claboxico'),
'section' => 'primairy_color',
'setting' => 'primairy_color',
) ));
//link kleur
$wp_customize->add_section('link_color', array(
'title' => __('Link Colors', 'claboxico'),
'panel' => 'colors',
'description' => 'Edit the color of the links.'
));
$wp_customize->add_setting('link_color', array(
'default' => '#0eb1ed',
));
$wp_customize->add_control( new WP_Customize_Color_control( $wp_customize, 'link_color', array(
'label' => __('Link Color', 'claboxico'),
'section' => 'link_color',
'setting' => 'link_color',
) ));
//plain text color
$wp_customize->add_section('paragraph_color', array(
'title' => __('Paragraph Colors', 'claboxico'),
'panel' => 'colors',
'description' => 'Edit the paragraph text color.'
));
$wp_customize->add_setting('paragraph_color', array(
'default' => '#000',
));
$wp_customize->add_control( new WP_Customize_Color_control( $wp_customize, 'paragraph_color', array(
'label' => __('Link Color', 'claboxico'),
'section' => 'paragraph_color',
'setting' => 'paragraph_color',
) ));
//fonts panel
$wp_customize->add_panel( 'fonts', array(
'title' => __( 'Fonts' ),
'description' => 'Edit the fonts',
) );
//heading fonts section
$wp_customize->add_section('heading_font', array(
'title' => __('Heading fonts', 'claboxico'),
'panel' => 'fonts',
'description' => 'Edit the font for h1, h2 etc.'
));
$wp_customize->add_setting('heading_font', array(
'default' => 'Rokkitt',
));
$wp_customize->add_control( 'heading_font',array(
'type' => 'select',
'label' => __('Heading font', 'claboxico'),
'section' => 'heading_font',
'setting' => '',
'choices' => $googlefonts,
)
);
}
function claboxico_css_customizer() {
?>
<style type="text/css">
#import url(http://fonts.googleapis.com/css?family=<?php
$font_sizes = ':300,400,700,900|';
$heading_google_font = get_theme_mod('heading_font');
$heading_font = str_replace(' ', '+', $heading_google_font);
echo $heading_font;
echo $font_sizes;
$paragraph_google_font = get_theme_mod('paragraph_font');
$paragraph_font = str_replace(' ', '+', $paragraph_google_font);
echo $paragraph_font;
echo $font_sizes;
?>);
body{font-family: '<?php echo get_theme_mod('paragraph_font'); ?>'; color: <?php echo get_theme_mod('paragraph_color'); ?> }
/* background color */
.header{background-color: <?php echo get_theme_mod('header_background_color'); ?> ;}
/* heading colors and font */
h1, h2, h3, header .logo{color: <?php echo get_theme_mod('primairy_color', '#43bfd8');?> ; font-family:'<?php echo get_theme_mod('heading_font'); ?>';}
/*link colors*/
a, a:hover{color: <?php echo get_theme_mod('link_color');?>;}
/* primairy colors */
header{border-bottom-color: <?php echo get_theme_mod('primairy_color', '#43bfd8');?> ;}
header .mobile-header-icon, header nav ul li a{color: <?php echo get_theme_mod('primairy_color', '#43bfd8');?> ;}
footer{border-top-color: <?php echo get_theme_mod('primairy_color', '#43bfd8');?> ;}
</style>
<?php
}
add_action('wp_head', 'claboxico_css_customizer');
add_action( 'customize_register', 'claboxico_customize_register' );
?>
I hope someone can help me with this problem.
Function get_theme_mod can take two parameters.
$name (required) = name of setting
$default (optional) = default value if there is no value set in the database
Check Codex page: https://codex.wordpress.org/Function_Reference/get_theme_mod
Example:
$color = get_theme_mod( 'link_color', '#ff0000' );
In this example default value of #ff0000 is passed. If value is set then that saved value will returned otherwise $color will get default value #ff0000.

Wordpress functions don't save

I am making a wordpress theme for free download.
I made some theme functions with $wp_customize what looks like this:
<?php
// theme options
function basilico_customizer_register($wp_customize) {
// Blog styling
$wp_customize->add_section('basilico_blog_styling', array(
'title' => __('Blog styling', 'basilico'),
'description' => 'Styling the blog'
));
$wp_customize->add_setting('main_color', array(
'default' => '#1b9145',
));
$wp_customize->add_control( new WP_Customize_color_Control($wp_customize, 'main_color', array(
'label' => __('Edit main background', 'basilico'),
'section' => 'basilico_blog_styling',
'settings' => 'main_color'
) ));
$wp_customize->add_setting('background_pattern', array(
'default' => get_template_directory_uri() . '/includes/bg.png',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'background_pattern', array(
'label' => __('Edit background pattern', 'basilico'),
'section' => 'basilico_blog_styling',
'settings' => 'background_pattern'
) ));
// General settings
$wp_customize->add_section('basilico_general_settings', array(
'title' => __('Change logo', 'basilico'),
'description' => 'setting the general settings'
));
$wp_customize->add_setting('logo_image', array(
'default' => get_template_directory_uri() . '/includes/logo.png',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'logo_image', array(
'label' => __('Edit logo image', 'basilico'),
'section' => 'basilico_general_settings',
'settings' => 'logo_image'
) ));
}
function basilico_css_customizer() {
?>
<style type="text/css">
.article_header,.button a,#bar1,#bar2,#bar3,thead th,.widget_title,#footer,nav ul li a:hover,nav ul li.current-menu-item > a,.nav-previous a,.nav-next a{
background-color:<?php echo get_theme_mod('main_color'); ?>;
}
.single_article_author span,.single_article_author span a,.cbp-spmenu .menu-item-has-children:before,ol li,h1,h2,h3,h4,hr,a{
color:<?php echo get_theme_mod('main_color'); ?>;
}
hr{
border-top: 2px solid <?php echo get_theme_mod('main_color'); ?>;
}
#overflow_container,body{
background-image:url(<?php echo get_theme_mod('background_pattern'); ?>);
}
</style>
<?php
}
add_action('customize_register', 'basilico_customizer_register');
add_action('wp_head', 'basilico_css_customizer');
?>
I tried to open my theme in a clean wordpress install, but all the defaults do not show..
Does someone know how to save these settings so the default settings show immediately after installing the theme.

Categories