Пример #1
0
/**
 * This will output the logo url.
 *
 * @return string Returns logo url.
 */
function apollo_get_logo()
{
    $logo = apollo_get_option('logo');
    if (isset($logo) && $logo != "") {
        return $logo;
    } else {
        if (file_exists(get_stylesheet_directory() . "/assets/images/logo.png")) {
            return get_stylesheet_directory_uri() . "/assets/images/logo.png";
        } else {
            return get_template_directory_uri() . "/assets/images/logo.png";
        }
    }
}
Пример #2
0
<header id="masthead" class="site-header row apollo-logo-left <?php 
apollo_get_header_css_class();
?>
" role="banner">

	<nav id="site-navigation" class="navbar navbar-default apollo-navbar-default" role="navigation">

		<div class="apollo-navbar-wrapper <?php 
echo apollo_get_option('header_wrapped') ? 'apollo-wrapper' : '';
?>
">

			<div class="navbar-header">

				<div class="site-branding">
				
					<div class="site-logo-wrapper">
						<a href="<?php 
echo esc_url(home_url('/'));
?>
" rel="home">
							<img src="<?php 
echo apollo_get_logo();
?>
" alt="<?php 
echo get_bloginfo('title');
?>
" class="site-logo image-responsive">
						</a>
					</div>
Пример #3
0
<?php

$wp_customize->add_panel('apollo_main_settings', array('title' => esc_html__('Main settings', 'apollo'), 'priority' => 11));
$wp_customize->get_section('title_tagline')->panel = 'apollo_main_settings';
$wp_customize->get_section('background_image')->panel = 'apollo_main_settings';
$wp_customize->get_section('colors')->panel = 'apollo_main_settings';
/*
 * ============== TITLE TAGLINE ==============
 */
$wp_customize->add_setting('logo', array('default' => apollo_get_option("logo")));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => esc_html__('Logo', 'apollo'), 'section' => 'title_tagline', 'settings' => 'logo', 'priority' => 1)));
/*
 * ============== COLORS ==============
 */
$wp_customize->add_setting('page_bg_color', array('default' => apollo_get_option('page_bg_color'), 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'apollo_page_bg_color', array('label' => esc_html__('Page container background color', 'apollo'), 'section' => 'colors', 'settings' => 'page_bg_color', 'priority' => 20)));
/*
 * ============== LAYOUT ==============
 */
$wp_customize->add_section('apollo_layout', array('title' => esc_html__('Layout', 'apollo'), 'panel' => 'apollo_main_settings', 'priority' => 40));
// Container_class
$wp_customize->add_setting('container_class', array('default' => apollo_get_option('container_class'), 'transport' => 'postMessage', 'sanitize_callback' => 'apollo_sanitize_container'));
$wp_customize->add_control('apollo_container_class', array('label' => esc_html__('Container', 'apollo'), 'section' => 'apollo_layout', 'settings' => 'container_class', 'type' => 'select', 'choices' => array('container-fluid' => esc_html__('Fluid', 'apollo'), 'container' => esc_html__('Fixed', 'apollo')), 'priority' => 10));
// Wrapper container max width
$wp_customize->add_setting('wrapped_element_max_width', array('default' => apollo_get_option('wrapped_element_max_width'), 'transport' => 'postMessage', 'sanitize_callback' => 'apollo_sanitize_int', 'sanitize_js_callback' => 'apollo_sanitize_int'));
$wp_customize->add_control('apollo_wrapped_element_max_width', array('label' => esc_html__('Wrapped element max width (px)', 'apollo'), 'description' => esc_html__('Site elements like header, blog, etc. could be wrapped. Value must be a positive number.', 'apollo'), 'section' => 'apollo_layout', 'settings' => 'wrapped_element_max_width', 'type' => 'text', 'priority' => 20, 'active_callback' => 'apollo_is_container_fluid_callback'));
Пример #4
0
<?php

/*
 * ============== Header Layout ==============
 */
$wp_customize->add_section('apollo_header_layout', array('title' => esc_html__('Layout', 'apollo'), 'panel' => 'apollo_header', 'priority' => 10));
// Header Template
$wp_customize->add_setting('header_template', array('default' => apollo_get_option('header_template')));
$wp_customize->add_control('apollo_header_template', array('label' => esc_html__('Template', 'apollo'), 'section' => 'apollo_header_layout', 'settings' => 'header_template', 'type' => 'select', 'choices' => apollo_get_header_templates(), 'priority' => 10));
// Fixed header max width
$wp_customize->add_setting('header_wrapped', array('default' => apollo_get_option('header_wrapped'), 'transport' => 'postMessage'));
$wp_customize->add_control('apollo_header_wrapped', array('label' => esc_html__('Wrapped', 'apollo'), 'description' => esc_html__('Value is set in "Main settings -> Layout"', 'apollo'), 'section' => 'apollo_header_layout', 'settings' => 'header_wrapped', 'type' => 'checkbox', 'priority' => 20));
// Header position
$wp_customize->add_setting('header_position', array('default' => apollo_get_option('header_position'), 'transport' => 'postMessage'));
$wp_customize->add_control('apollo_header_position', array('label' => esc_html__('Position', 'apollo'), 'section' => 'apollo_header_layout', 'settings' => 'header_position', 'type' => 'select', 'choices' => array('' => esc_html__('Top', 'apollo'), 'apollo-header-sticky-top' => esc_html__('Fixed top', 'apollo')), 'priority' => 30));
// Fix primary menu when to long
$wp_customize->add_setting('header_menu_fix', array('default' => apollo_get_option('header_menu_fix'), 'transport' => 'postMessage'));
$wp_customize->add_control('apollo_header_menu_fix', array('label' => esc_html__('Fix menu position when over logo', 'apollo'), 'section' => 'apollo_header_layout', 'settings' => 'header_menu_fix', 'type' => 'checkbox', 'priority' => 40));
Пример #5
0
<?php

/*
 * ============== HEADER COLORS ==============
 */
$wp_customize->add_section('apollo_header_colors', array('title' => esc_html__('Colors', 'apollo'), 'panel' => 'apollo_header', 'priority' => 20));
// Header background color
$wp_customize->add_setting('header_bg_color', array('default' => apollo_get_option('header_bg_color'), 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'apollo_header_bg_color', array('label' => esc_html__('Background color', 'apollo'), 'section' => 'apollo_header_colors', 'settings' => 'header_bg_color', 'priority' => 10)));
// Header background color opacity
$wp_customize->add_setting('header_bg_color_opacity', array('default' => apollo_get_option('header_bg_color_opacity'), 'sanitize_callback' => 'apollo_sanitize_opacity', 'transport' => 'postMessage'));
$wp_customize->add_control('apollo_header_bg_color_opacity', array('label' => esc_html__('Background opacity', 'apollo'), 'section' => 'apollo_header_colors', 'settings' => 'header_bg_color_opacity', 'type' => 'range', 'priority' => 20, 'input_attrs' => array('min' => 0, 'max' => 1, 'step' => 0.1)));
// Header background color opacity on scrolling
$wp_customize->add_setting('header_bg_color_opacity_onscroll', array('default' => apollo_get_option('header_bg_color_opacity_onscroll'), 'sanitize_callback' => 'apollo_sanitize_opacity', 'transport' => 'postMessage'));
$wp_customize->add_control('apollo_header_bg_color_opacity_onscroll', array('label' => esc_html__('Scrolling background opacity', 'apollo'), 'description' => esc_html__('Opacity on scrolling if fixed top.', 'apollo'), 'section' => 'apollo_header_colors', 'settings' => 'header_bg_color_opacity_onscroll', 'type' => 'range', 'priority' => 30, 'input_attrs' => array('min' => 0, 'max' => 1, 'step' => 0.1)));
// Typography colors
$wp_customize->add_setting('header_title_color', array('default' => apollo_get_option('header_title_color'), 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'apollo_header_title_color', array('label' => esc_html__('Title', 'apollo'), 'section' => 'apollo_header_colors', 'settings' => 'header_title_color', 'priority' => 40)));
$wp_customize->add_setting('header_description_color', array('default' => apollo_get_option('header_description_color'), 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'apollo_header_description_color', array('label' => esc_html__('Blog description', 'apollo'), 'section' => 'apollo_header_colors', 'settings' => 'header_description_color', 'priority' => 50)));
Пример #6
0
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
">

<?php 
wp_head();
?>
</head>

<body <?php 
body_class();
?>
>
<div id="page" class="site <?php 
echo apollo_get_option('container_class');
?>
">

	<a class="skip-link screen-reader-text" href="#content"><?php 
esc_html_e('Skip to content', 'apollo');
?>
</a>
	
	<?php 
locate_template('template-parts/header/' . apollo_get_option('header_template') . '.php', true, true);
?>

	<div id="content" class="site-content">