Ejemplo n.º 1
0
    function wpex_page_header($before = '', $after = '', $breadcrumbs = true)
    {
        // Vars
        global $post;
        $output = $title_style = $classes = $height = $style = $title_background = $disable_title = '';
        $heading = apply_filters('wpex_page_header_heading', 'h1');
        if ($post) {
            $post_id = $post->ID;
            $disable_title = get_post_meta(get_the_ID(), 'wpex_disable_title', true);
            $title = get_the_title();
        }
        // If page header is disabled do nothing
        if ($disable_title == 'on') {
            return false;
        }
        // Page meta options
        if (is_singular('page') || is_singular('portfolio') || is_singular('staff')) {
            $title_style = get_post_meta($post_id, 'wpex_post_title_style', true);
            if ($title_style == 'background-image') {
                $title_background = get_post_meta($post_id, 'wpex_post_title_background', true);
                $title_height = get_post_meta($post_id, 'wpex_post_title_height', true);
                $title_height = $title_height ? $title_height : '400';
                $title_height = intval($title_height) . 'px';
                // set height in pixels
            }
            // Custom Classes
            if ($title_style !== 'default') {
                $classes .= $title_style . '-page-header';
            }
            // Header Background Image
            if ($title_background) {
                $style .= ' background: url(' . $title_background . ') 50% 0;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;height: ' . $title_height . ';';
            }
            // Disable breadcrumbs if background image set
            if ($title_background || $title_style == 'centered' || $title_style == 'centered-minimal') {
                $breadcrumbs = false;
            }
        }
        ob_start();
        ?>
		
			<?php 
        echo $before;
        ?>
				
				<header class="page-header <?php 
        echo $classes;
        ?>
" style="<?php 
        echo $style;
        ?>
">
					
					<div class="container clr page-header-inner">
						<?php 
        //  Main header
        echo '<' . $heading . ' class="page-header-title">' . wpex_page_title() . '</' . $heading . '>';
        // Function used to display the subheading defined in the meta options
        // See previous function
        echo wpex_post_subheading();
        // Display built-in breadcrumbs - see functions/breadcrumbs.php
        if (!is_front_page() && $breadcrumbs) {
            wpex_display_breadcrumbs();
        }
        ?>
						
					</div><!-- .page-header-inner -->
					
					<?php 
        // Header backgroun overlay
        if ($title_background) {
            ?>
						<span class="background-image-page-header-overlay "></span>
					<?php 
        }
        ?>
						
				</header><!-- .page-header -->
			
			<?php 
        echo $after;
        ?>
		
		<?php 
        echo ob_get_clean();
    }
Ejemplo n.º 2
0
}
?>
    
    <?php 
// Header For Product Pages
if (is_singular('product')) {
    $obj = get_post_type_object('product');
    ?>
		<header class="page-header">
			<div class="container clr">
				<h1 class="page-header-title"><?php 
    echo wpex_option('woo_shop_single_title', __('Shop', 'wpex'));
    ?>
</h1>
              <?php 
    wpex_display_breadcrumbs();
    // see functions/breadcrumbs.php
    ?>
			</div>
		</header>
    <?php 
}
?>
    
    <div id="content-wrap" class="container clr <?php 
echo $wpex_woo_layout_class;
?>
">
        <section id="primary" class="content-area clr">
            <div id="content" class="clr site-content" role="main">
				<article class="entry-content entry clr">
Ejemplo n.º 3
0
// Top Hook
wpex_hook_page_header_top();
?>
		<div class="container clr page-header-inner">
			<?php 
// Inner hook
wpex_hook_page_header_inner();
//  Display header and subheading if enabled
if ($display_title) {
    // Display the main header title
    $heading = apply_filters('wpex_page_header_heading', 'h1');
    echo '<' . $heading . ' class="page-header-title">' . wpex_page_title($post_id) . '</' . $heading . '>';
    // Function used to display the subheading defined in the meta options
    wpex_post_subheading($post_id);
}
// Display built-in breadcrumbs - see functions/breadcrumbs.php
if ($display_breadcrumbs) {
    wpex_display_breadcrumbs($post_id);
}
?>
		</div><!-- .page-header-inner -->
		<?php 
// Page header overlay
wpex_page_header_overlay($post_id);
// Bottom Hook
wpex_hook_page_header_bottom();
?>
	</header><!-- .page-header -->
<?php 
// After Hook
wpex_hook_page_header_after();