"'open sans'",
'Roboto' => "'roboto'",
'Roboto Slab' => "'roboto slab'",
'Lato' => "'lato'",
'Roboto Condensed' => "'roboto condensed'",
'Raleway' => "'raleway'",
'Lobster Two' => "'lobster two'",
'Merriweather' => "'merriweather'",
'Parisienne' => "'parisienne'"
);
$selected_cfont = get_sircontheme_option('cfont');
$cfont_name = array_search($selected_cfont, $main_fonts);
$selected_tfont = get_sircontheme_option('tfont');
$tfont_name = array_search($selected_tfont, $main_fonts);
$tfont_name = str_replace(' ', '+', $tfont_name);
$cfont_name = str_replace(' ', '+', $cfont_name);
add_action('wp_head', function() use($tfont_name, $cfont_name){
$protocol = (empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'on') ? 'http' : 'https';
echo '';
});
/* ----------------------------------------
FONT SIZES
------------------------------------------- */
$title_sizes = array(
__('Big', 'sircon_evo') => '54px',
__('Medium', 'sircon_evo') => '40px',
__('Small', 'sircon_evo') => '28px'
);
$font_sizes = array(
__('Big', 'sircon_evo') => '18px',
__('Medium', 'sircon_evo') => '16px',
__('Small', 'sircon_evo') => '13px'
);
/*----------------------------------------
HEADER STYLES
-----------------------------------------*/
$header_styles = array(
__('Normal', 'sircon_evo') => 'default',
__('Full width', 'sircon_evo') => 'fullwidth'
);
/*----------------------------------------
BLOG INFO DISPLAY
-----------------------------------------*/
$bloginfo_settings = array(
__('Show blog title and blog description', 'sircon_evo') => 'default',
__('Show blog title only', 'sircon_evo') => 'title',
__('Hide both blog title and description', 'sircon_evo') => 'none'
);
// #### Add a new page! #### //
add_sircontheme_option_type('pagebreak', array(
'name' => 'header-settings',
'label' => 'Header'
));
// Show/hide title and description
add_sircontheme_option_type('select', array(
'name' => 'bloginfo-setting',
'label' => __('Display blog info', 'sircon_evo'),
'tooltip' => __('Hide or show blog info here. (Edit your blog title or description here)', 'sircon_evo'),
'default' => 'title',
'options' => $bloginfo_settings
));
// Align title, description and logo
add_sircontheme_scss_variable('select', array(
'name' => 'title-align',
'label' => __('Choose how the blog info is aligned', 'sircon_evo'),
'tooltip' => __('Left, center or right-aligned blog info.', 'sircon_evo'),
'default' => 'left',
'options' => array (
__('Left', 'sircon_evo') => 'left',
__('Center', 'sircon_evo') => 'center',
__('Right', 'sircon_evo') => 'right'
)
));
add_sircontheme_scss_variable('select', array(
'name' => 'menu-align',
'label' => __('Choose how the top menu links are aligned', 'sircon_evo'),
'tooltip' => __('Left, center or right-aligned top menu links', 'sircon_evo'),
'default' => 'left',
'options' => array (
__('Left', 'sircon_evo') => 'left',
__('Center', 'sircon_evo') => 'center',
__('Right', 'sircon_evo') => 'right'
)
));
add_sircontheme_scss_variable('select', array(
'name' => 'menu-position',
'label' => __('Sticky top menu?', 'sircon_evo'),
'tooltip' => __('Sticky menu means a top menu that follows the page when scrolling', 'sircon-evo'),
'default' => 'relative',
'options' => array(
__('No', 'sircon_evo') => 'relative',
__('Yes', 'sircon_evo') => 'fixed'
)
));
$default_header = get_template_directory_uri().'/package/images/default_header.jpg';
// Upload header-img
add_sircontheme_option_type('image', array(
'name' => 'header-img',
'default' => $default_header,
'enabler' => __('Upload a header image', 'sircon_evo'),
));
// Fullwidth or normal header
add_sircontheme_option_type('select', array(
'name' => 'header-style',
'label' => __('Choose header style', 'sircon_evo'),
'tooltip' => __('Full width covers entire screen width if image is big enough.', 'sircon_evo'),
'default' => 'default',
'options' => $header_styles
));
// Fullwidth or normal header
add_sircontheme_option_type('checkbox', array(
'name' => 'frontpage-header',
'label' => __('Show header only on frontpage', 'sircon_evo'),
'tooltip' => __('If checked, header will only show on frontpage. If unchecked, header image will appear on all pages.', 'sircon_evo'),
'default' => false,
));
$default_logo = get_template_directory_uri().'/package/images/default_logo.png';
// Upload logo
add_sircontheme_option_type('image', array(
'name' => 'logo-img',
'default' => $default_logo,
'enabler' => __('Upload a logo', 'sircon_evo'),
));
// Upload favicon
add_sircontheme_option_type('image', array(
'name' => 'favicon-img',
'enabler' => __('Upload a favicon', 'sircon_evo'),
));
// #### Add a new page! #### //
add_sircontheme_option_type('pagebreak', array(
'name' => 'color-settings',
'label' => __('Colors', 'sircon_evo')
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'theme-color',
'default' => '#9d7c6a',
'tooltip' => __('Main theme color is the most important color in the theme','sircon_evo'),
'label' => __('Main theme color', 'sircon_evo'),
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'background',
'default' => '#f7f7f7',
'tooltip' => __('Background color', 'sircon_evo'),
'label' => __('The color of the background behind the blog.', 'sircon_evo'),
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'link-color',
'default' => '#8c4f4f',
'tooltip' => __('Link color for content and sidebar links', 'sircon_evo'),
'label' => __('Link color', 'sircon_evo')
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'light-grey',
'default' => '#dddddd',
'tooltip' => __('Button color should be light', 'sircon_evo'),
'label' => __('Button color (light)', 'sircon_evo'),
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'title-color',
'default' => '#555555',
'tooltip' => __('The title color is used for all titles, h1-h6', 'sircon_evo'),
'label' => __('Title color', 'sircon_evo')
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'text-color-dark',
'enabler' => __('Override content text color (not recommended)', 'sircon_evo'),
'label' => __('Content text color', 'sircon_evo'),
));
add_sircontheme_scss_variable('colorpicker', array(
'name' => 'contentbg',
'enabler' => __('Override content background (not recommended)', 'sircon_evo'),
'label' => __('Content background color', 'sircon_evo')
));
// #### Add a new page! #### //
add_sircontheme_option_type('pagebreak', array(
'name' => 'font-settings',
'label' => __('Fonts', 'sircon_evo')
));
// Main font!
add_sircontheme_scss_variable('select', array(
'name' => 'cfont',
'label' => __('Main font', 'sircon_evo'),
'default' => "'Open Sans'",
'options' => $main_fonts
));
// Title font!
add_sircontheme_scss_variable('select', array(
'name' => 'tfont',
'label' => __('Title font', 'sircon_evo'),
'default' => "'Open Sans'",
'options' => $main_fonts
));
$preview_src = get_template_directory_uri().'/package/images/google-fonts.jpg';
add_sircontheme_option_type('custom', array(
'name' => 'font-preview',
'enabler' => __('Open font preview', 'sircon_evo'),
'value' => '
'
)
);
// Title font weight
add_sircontheme_scss_variable('select', array(
'name' => 'tweight',
'label' => __('Title font weight', 'sircon_evo'),
'default' => '400',
'options' => array(
__('Normal', 'sircon_evo') => '400',
__('Thin', 'sircon_evo') => '300',
__('Bold', 'sircon_evo') => '700'
)
));
//Title align
add_sircontheme_scss_variable('select', array(
'name' => 'talign',
'label' => __('Post/page title align', 'sircon_evo'),
'default' => 'left',
'tooltip' => __('Left, center or right-aligned post and page titles', 'sircon_evo'),
'options' => array(
__('Left', 'sircon_evo') => 'left',
__('Center', 'sircon_evo') => 'center',
__('Right', 'sircon_evo') => 'right'
)
));
// Title font sizes
add_sircontheme_scss_variable('select', array(
'name' => 'tfsize',
'label' => __('Title size', 'sircon_evo'),
'tooltip' => __('Affects all titles, as they adjust accordingly', 'sircon_evo'),
'default' => '40px',
'options' => $title_sizes
));
// Font size
add_sircontheme_scss_variable('select', array(
'name' => 'fsize',
'label' => __('Content font size', 'sircon_evo'),
'tooltip' => __('Size of readable text content in posts and pages', 'sircon_evo'),
'default' => '16px',
'options' => $font_sizes
));
// #### Add a new page! #### //
add_sircontheme_option_type('pagebreak', array(
'name' => 'design-settings',
'label' => __('Advanced', 'sircon_evo')
));
/* Add simple/advanced view selection for admin control panel */
add_sircontheme_option_type('checkbox', array(
'name' => 'admin-advanced-version',
'label' => __('Want to install plugins, adjust settings and such? Activate advanced dashboard', 'sircon_evo'),
'tooltip' => __('The simple dashboard is there to make your life easier. If you want more functionality, activate the advanced dashboard', 'sircon_evo'),
));
add_sircontheme_option_type('textarea', array(
'name' => 'custom-css',
'label' => __('Familiar with css? Make your own design changes by writing your own css on top of the themes css', 'sircon_evo'),
'tooltip' => __('Tip: Use the code inspector in your browser to view ID and classnames used in this theme', 'sircon_evo'),
));
function sircontheme_usercss() {
$style_override = get_sircontheme_option('custom-css');
if($style_override) {
echo '';
};
}
// *************************
// MAGIC
// *************************
// Add bloginfo body class
$bloginfo_setting = get_sircontheme_option('bloginfo-setting');
add_sircontheme_body_class('bloginfo-setting-'.$bloginfo_setting);
// Add header body class
$header_style = get_sircontheme_option('header-style');
add_sircontheme_body_class('header-style-'.$header_style);
});
// *********************************
// RESET BUTTON - LAST 200 priority
// *********************************
add_action('init', function(){
add_sircontheme_option_type('pagebreak', array(
'name' => 'reset-setting',
'label' => __('Reset', 'sircon_evo'),
));
add_sircontheme_option_type('custom', array(
'name' => 'reset-warning',
'label' => __('By resetting theme options you will get the default options, leaving the theme looking exactly the same as when you installed it. Resetting will remove all the changes you have done, including CSS under advanced settings.', 'sircon_evo'),
));
add_sircontheme_option_reset_button('Reset all theme settings');
}, 200);