true,
'flex-height' => true,
'width' => 1050,
'height' => 200,
'default-image' => '',
));
/**
* Enable support for a custom background
*/
add_theme_support('custom-background', array(
'default-color' => '#232B2B',
));
/**
* This theme uses wp_nav_menu() in one location.
*/
register_nav_menus(array(
'primary' => __('Primary Menu', 'aplos'),
));
if (! isset($content_width)) {
$content_width = 654;
}
}
endif; // aplos_setup
add_action('after_setup_theme', 'aplos_setup');
/**
* Register widgetized area and update sidebar with default widgets
*
* @since Aplos 1.2.0
*/
function aplos_widgets_init()
{
register_sidebar(array(
'name' => __('Primary Widget Area', 'aplos'),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
));
register_sidebar(array(
'name' => __('Secondary Widget Area', 'aplos'),
'id' => 'sidebar-2',
'before_widget' => '',
'before_title' => '',
));
}
add_action('widgets_init', 'aplos_widgets_init');
/**
* Filter the wp_title tag
*
* @since Aplos 1.2.0
*/
function aplos_wp_title($title, $sep)
{
if (is_feed()) {
return $title;
}
global $page, $paged;
// Add blog name
$title .= get_bloginfo('name', 'display');
//Add blog description for home page
$site_description = get_bloginfo('description', 'display');
if ($site_description && (is_home() || is_front_page())) {
$title .= " $sep $site_description";
}
// Add page number
if (($paged >= 2 || $page >= 2) && ! is_404()) {
$title .= " $sep " . sprintf(__('Page %s', 'aplos'), max($paged, $page));
}
return $title;
}
add_filter('wp_title', 'aplos_wp_title', 10, 2);
/**
* Get default customization options
*
* @since Aplos 1.2.0
*/
function aplos_get_defaults()
{
return array(
'colors' => array(
'title' => '#DC3D24',
'background' => '#232B2B',
'content_background' => '#FFF',
'site_description' => '#FFF',
'text_color' => '#000',
'link' => '#8F1E0C',
'link_hover' => '#EE6D59',
'button_border' => '#5E0D00',
'button_text' => '#FFF',
)
);
}
/**
* Add editor styling theme support
*
* @since Aplos 1.2.0
*/
function aplos_theme_editor_add_styles()
{
add_editor_style();
}
add_action('admin_init', 'aplos_theme_editor_add_styles');
/**
* Add customization settings to Appearance menu
*
* @since Aplos 1.2.0
*/
function aplos_customize_register($wp_customize)
{
// Layout Section
$wp_customize->add_section('aplos_layout_choice_section', array(
'title' => __('Layout', 'aplos'),
'priority' => 30,
'description' => __('Allows you to customize page layout.', 'aplos'),
));
// Fonts Section
$wp_customize->add_section('aplos_fonts_choice_section', array(
'title' => __('Fonts', 'aplos'),
'priority' => 30,
'description' => __('Change the font of the site title, post titles, and headings.
Theme Default: Suggested. Supports most special characters in the Latin alphabet.
Roboto Condensed: Wide language support. Supports special Latin characters, Greek, Cyrillic, and Vietnamese.
Verdana: Not suggested. Only use this is a fallback font if the other included fonts do not contain the characters required by your language.', 'aplos'),
));
// Site Text Section
$wp_customize->add_section('aplos_site_text_section', array(
'title' => __('Site Text', 'aplos'),
'priority' => 30,
'description' => __('Customize text within the theme.', 'aplos'),
));
//Layout settings
$wp_customize->add_setting('layout_choices',
array(
'default' => 'twocol',
'sanitize_callback' => 'aplos_sanitize_columns',
)
);
$wp_customize->add_setting('collapsible_nav',
array(
'default' => true,
'sanitize_callback' => 'aplos_sanitize_boolean',
)
);
//Fonts settings
$wp_customize->add_setting('fonts_choices',
array(
'default' => 'bebas',
'type' => 'theme_mod',
'sanitize_callback' => 'aplos_sanitize_font',
)
);
//Color settings
$wp_customize->add_setting('title_color',
array(
'default' => '#DC3D24',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('themebg_color',
array(
'default' => '#232B2B',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('content_bg_color',
array(
'default' => '#FFF',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('site_description',
array(
'default' => '#FFF',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('text_color',
array(
'default' => '#000',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('link_color',
array(
'default' => '#8F1E0C',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('link_hover_color',
array(
'default' => '#EE6D59',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('button_border_color',
array(
'default' => '#5E0D00',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_setting('button_text_color',
array(
'default' => '#FFF',
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_hex_color',
)
);
// Site Text settings
$wp_customize->add_setting('read_more_text',
array(
'default' => __('Read More', 'aplos'),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_setting('post_date_text',
array(
'default' => __('Posted on', 'aplos'),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_setting('categories_text',
array(
'default' => __('Filed Under:', 'aplos'),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_setting('tags_text',
array(
'default' => __('Tagged:', 'aplos'),
'type' => 'theme_mod',
'sanitize_callback' => 'sanitize_text_field',
)
);
//Layout Controls
$wp_customize->add_control('layout_choices',
array(
'type' => 'radio',
'label' => __('Select Layout', 'aplos'),
'section' => 'aplos_layout_choice_section',
'choices' => array(
'twocol' => __('Two Columns', 'aplos'),
'threecol' => __('Three Columns', 'aplos'),
),
)
);
$wp_customize->add_control('collapsible_nav',
array(
'type' => 'checkbox',
'label' => __('Use collapsible menu on small screens', 'aplos'),
'section' => 'aplos_layout_choice_section',
)
);
//Fonts Controls
$wp_customize->add_control('fonts_choices',
array(
'type' => 'select',
'label' => __('Select Title Font', 'aplos'),
'section' => 'aplos_fonts_choice_section',
'choices' => array(
'BebasNeue' => __('Theme Default', 'aplos'),
'\'Roboto Condensed\'' => __('Roboto Condensed', 'aplos'),
'Verdana' => __('Verdana', 'aplos'),
),
)
);
//Color Controls
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_themebg_color',
array(
'label' => __('Background Color', 'aplos'),
'section' => 'colors',
'settings' => 'themebg_color',
'priority' => 5,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_title_color', //Set a unique ID for the control
array(
'label' => __('Title Color', 'aplos'), //Admin-visible name of the control
'section' => 'colors', //ID of section
'settings' => 'title_color', //Which setting to load and manipulate (serialized is okay)
'priority' => 6, //Determines the order this control appears in for the specified section
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_site_description',
array(
'label' => __('Site Description Color', 'aplos'),
'section' => 'colors',
'settings' => 'site_description',
'priority' => 7,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_content_bg_color',
array(
'label' => __('Content Background Color', 'aplos'),
'section' => 'colors',
'settings' => 'content_bg_color',
'priority' => 10,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_text_color',
array(
'label' => __('Text Color', 'aplos'),
'section' => 'colors',
'settings' => 'text_color',
'priority' => 11,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_link_color',
array(
'label' => __('Link Color', 'aplos'),
'section' => 'colors',
'settings' => 'link_color',
'priority' => 15,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_link_hover_color',
array(
'label' => __('Link Hover Color', 'aplos'),
'section' => 'colors',
'settings' => 'link_hover_color',
'priority' => 20,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_button_border_color',
array(
'label' => __('Button Border Color', 'aplos'),
'section' => 'colors',
'settings' => 'button_border_color',
'priority' => 25,
)
));
$wp_customize->add_control(new WP_Customize_Color_Control(
$wp_customize,
'aplos_button_text_color',
array(
'label' => __('Button Text Color', 'aplos'),
'section' => 'colors',
'settings' => 'button_text_color',
'priority' => 30,
)
));
// Site Text Controls
$wp_customize->add_control('read_more_text',
array(
'type' => 'input',
'label' => __('Read More link', 'aplos'),
'section' => 'aplos_site_text_section',
)
);
$wp_customize->add_control('post_date_text',
array(
'type' => 'input',
'label' => __('Post date text', 'aplos'),
'section' => 'aplos_site_text_section',
)
);
$wp_customize->add_control('categories_text',
array(
'type' => 'input',
'label' => __('Categories text', 'aplos'),
'section' => 'aplos_site_text_section',
)
);
$wp_customize->add_control('tags_text',
array(
'type' => 'input',
'label' => __('Tags text', 'aplos'),
'section' => 'aplos_site_text_section',
)
);
}
/**
* Add styles to the page based on customization options
*
* @since Aplos 1.2.0
*/
function aplos_customize_css()
{
// Theme defaults
$defaults = aplos_get_defaults();
//Fonts choices
$fontsChoice = get_theme_mod('fonts_choices', "BebasNeue");
$fontStart = $fontsChoice === 'verdana' ? '' : $fontsChoice.', ';
$fontEnding = "Verdana, sans-serif";
$font = $fontStart.$fontEnding;
?>