/** * Display the proper sub-header based on the provided arguments * * @param array $args The list of arguments */ public static function zn_get_subheader($args = array()) { $id = zn_get_the_id(); $defaults = array('headerClass' => 'zn_def_header_style', 'title' => get_the_title($id), 'layout' => zget_option('zn_disable_subheader', 'general_options'), 'def_header_bread' => zget_option('def_header_bread', 'general_options', false, 1), 'def_header_date' => zget_option('def_header_date', 'general_options', false, 1), 'def_header_title' => zget_option('def_header_title', 'general_options', false, 1), 'show_subtitle' => zget_option('def_header_subtitle', 'general_options', false, true), 'extra_css_class' => '', 'bottommask' => zget_option('def_bottom_style', 'general_options', false, 'none'), 'bg_source' => '', 'is_element' => false, 'inherit_head_pad' => true, 'title_heading' => 'h2'); $saved_headers = zget_option('header_generator', 'unlimited_header_options', false, array()); // Combine defaults with the options saved in post meta if (is_singular()) { // if ( is_singular() || is_home() || is_shop() ) { $post_defaults = array(); $title_bar_layout = get_post_meta($id, 'zn_zn_disable_subheader', true); if (!empty($title_bar_layout)) { $post_defaults = array('layout' => $title_bar_layout, 'subtitle' => get_post_meta($id, 'zn_page_subtitle', true)); $saved_title = get_post_meta($id, 'zn_page_title', true); if (!empty($saved_title)) { $post_defaults['title'] = $saved_title; } } // Sub-header style $zn_subheader_style = get_post_meta($id, 'zn_subheader_style', true); if (!empty($zn_subheader_style)) { $post_defaults['headerClass'] = 'uh_' . $zn_subheader_style; } // Get Subheader settings from Unlimited Subheader style foreach ($saved_headers as $header) { if (isset($header['uh_style_name']) && !empty($header['uh_style_name'])) { $header_name = strtolower(str_replace(' ', '_', $header['uh_style_name'])); if ($zn_subheader_style == $header_name) { $defaults['bottommask'] = $header['uh_bottom_style']; } } } $defaults = wp_parse_args($post_defaults, $defaults); } elseif (is_tax() || is_category()) { global $wp_query; $cat = $wp_query->get_queried_object(); if ($cat && isset($cat->term_id)) { $id = $cat->term_id; $ch = get_option('wpk_zn_select_custom_header_' . $id, false); if (!empty($ch)) { if ('zn_def_header_style' != $ch) { $defaults['headerClass'] = 'uh_' . $ch; } // Get Subheader settings from Unlimited Subheader style foreach ($saved_headers as $header) { if (isset($header['uh_style_name']) && !empty($header['uh_style_name'])) { $header_name = strtolower(str_replace(' ', '_', $header['uh_style_name'])); if ($ch == $header_name) { $defaults['bottommask'] = $header['uh_bottom_style']; } } } } } } $args = wp_parse_args($args, $defaults); $args = apply_filters('zn_sub_header', $args); // If the subheader shouldn't be shown if ($args['layout'] == 'yes') { return; } $extra_classes = array(); $bottom_mask = $args['bottommask']; if ($bottom_mask != 'none') { $extra_classes[] = 'maskcontainer--' . $bottom_mask; } $is_element = $args['is_element']; if ($is_element) { $extra_classes[] = 'page-subheader--custom'; } else { $extra_classes[] = 'page-subheader--auto'; } // Inherit heading & padding from Unlimited Subheader styles // Enabled by default for autogenerated pages and via option in Custom Subheader Element $inherit_head_pad = $args['inherit_head_pad']; if ($inherit_head_pad) { $extra_classes[] = 'page-subheader--inherit-hp'; } $extra_classes[] = $args['headerClass']; $extra_classes[] = $args['extra_css_class']; // Get Site Header's Position (relative | absolute) $header_pos = 'psubhead-stheader--absolute'; $headerLayoutStyle = zget_option('zn_header_layout', 'general_options', false, 'style2'); if (zget_option('head_position', 'general_options', false, '1') != 1) { if ($headerLayoutStyle != 'style7') { $header_pos = 'psubhead-stheader--relative'; } } $extra_classes[] = $header_pos; ?> <div id="page_header" class="page-subheader <?php echo implode(' ', $extra_classes); ?> "> <div class="bgback"></div> <?php $bg_source = $args['bg_source']; if (!empty($bg_source) && is_array($bg_source)) { WpkPageHelper::zn_background_source($bg_source); } ?> <div class="th-sparkles"></div> <!-- DEFAULT HEADER STYLE --> <div class="ph-content-wrap"> <div class="ph-content-v-center"> <div> <div class="container"> <div class="row"> <?php $br_date = (int) $args['def_header_bread'] || (int) $args['def_header_date']; $def_cols = $br_date ? 6 : 12; if ($br_date) { ?> <div class="col-sm-6"> <?php if ((int) $args['def_header_bread']) { zn_breadcrumbs(); } else { echo ' '; } if ((int) $args['def_header_date']) { echo '<span id="current-date" class="subheader-currentdate hidden-xs">' . date_i18n(get_option('date_format'), strtotime(date("l M d, Y") . get_option('gmt_offset')), false) . '</span>'; } else { echo ' '; } ?> <div class="clearfix"></div> </div> <?php } ?> <div class="col-sm-<?php echo $def_cols; ?> "> <div class="subheader-titles"> <?php if (!empty($args['def_header_title'])) { ?> <<?php echo $args['title_heading']; ?> class="subheader-maintitle"> <?php echo $args['title']; ?> </<?php echo $args['title_heading']; ?> > <?php } ?> <?php if (isset($args['show_subtitle']) && $args['show_subtitle'] && !empty($args['subtitle'])) { ?> <h4 class="subheader-subtitle"> <?php echo do_shortcode($args['subtitle']); ?> </h4> <?php } ?> </div> </div> </div> <!-- end row --> </div> </div> </div> </div> <?php WpkPageHelper::zn_bottommask_markup($bottom_mask); ?> </div> <?php }
function _header_module($options) { global $meta_fields; $height = ''; if (!empty($options['hm_header_style']) && $options['hm_header_style'] != 'zn_def_header_style') { $style = 'uh_' . $options['hm_header_style']; } elseif (!empty($options['hm_header_style']) && $options['hm_header_style'] == 'zn_def_header_style') { $style = 'zn_def_header_style'; } else { $style = ''; } if (!empty($options['hm_header_height'])) { $height = 'style="height:' . $options['hm_header_height'] . 'px;min-height:' . $options['hm_header_height'] . 'px"'; } ?> <div id="page_header" class="<?php echo $style; ?> bottom-shadow" <?php echo $height; ?> > <div class="bgback"></div> <div data-images="<?php echo IMAGES_URL; ?> /" id="sparkles"></div> <div class="container"> <div class="row"> <div class="span6"> <?php // Breadcrumbs check if (isset($options['hm_header_bread']) && !empty($options['hm_header_bread'])) { zn_breadcrumbs(); } // Date check if (isset($options['hm_header_date']) && !empty($options['hm_header_date'])) { echo '<span id="current-date">' . date_i18n(get_option('date_format'), strtotime(date("l M d, Y"))) . '</span>'; } ?> </div> <div class="span6"> <div class="header-titles"> <?php // Title check if (isset($options['hm_header_title']) && !empty($options['hm_header_title'])) { if (isset($meta_fields['page_title']) && !empty($meta_fields['page_title'])) { echo '<h2>' . do_shortcode(stripslashes($meta_fields['page_title'])) . '</h2>'; } else { echo '<h2>' . get_the_title() . '</h2>'; } } ?> <?php // Subtitle check if (isset($options['hm_header_subtitle']) && !empty($options['hm_header_subtitle'])) { if (isset($meta_fields['page_subtitle']) && !empty($meta_fields['page_subtitle'])) { echo '<h4>' . do_shortcode(stripslashes($meta_fields['page_subtitle'])) . '</h4>'; } } ?> </div> </div> </div><!-- end row --> </div> <div class="zn_header_bottom_style"></div> </div><!-- end page_header --> <?php }
<?php if (isset($data['def_header_animate']) && !empty($data['def_header_animate'])) { echo '<div data-images="' . IMAGES_URL . '/" id="sparkles"></div>'; } ?> <!-- DEFAULT HEADER STYLE --> <div class="container"> <div class="row"> <div class="span6"> <?php // Breadcrumbs check if (isset($data['def_header_bread']) && !empty($data['def_header_bread'])) { zn_breadcrumbs(); } // Date check if (isset($data['def_header_date']) && !empty($data['def_header_date'])) { echo '<span id="current-date">' . date_i18n(get_option('date_format'), strtotime(date("l M d, Y"))) . '</span>'; } ?> </div> <div class="span6"> <div class="header-titles"> <?php // Title check if (isset($data['def_header_title']) && !empty($data['def_header_title'])) { if (isset($meta_fields['page_title']) && !empty($meta_fields['page_title'])) { echo '<h2>' . do_shortcode(stripslashes($meta_fields['page_title'])) . '</h2>'; } elseif (is_post_type_archive('post') || is_home()) {