/** * Add page header * * @since 1.0 */ function kt_page_header() { global $post; $show_title = false; if (is_front_page() && is_singular('page')) { $show_title = rwmb_meta('_kt_page_header', array(), get_option('page_on_front', true)); if (!$show_title) { $show_title = kt_option('show_page_header', 1); } } elseif (is_archive()) { $show_title = kt_option('archive_page_header', 1); } elseif (is_search()) { $show_title = kt_option('search_page_header', 1); } elseif (is_404()) { $show_title = kt_option('notfound_page_header', 1); } else { if (is_page()) { $post_id = $post->ID; $show_title = rwmb_meta('_kt_page_header', array(), $post_id); if (!$show_title) { $show_title = kt_option('show_page_header', 1); } } else { $show_title = kt_option('show_page_header', 1); } } $show_title = apply_filters('kt_show_title', $show_title); if ($show_title == 'on' || $show_title == 1) { $title = kt_get_page_title(); $subtitle = kt_get_page_subtitle(); $title = '<h1 class="page-header-title">' . $title . '</h1>'; if ($subtitle != '') { $subtitle = '<div class="page-header-subtitle">' . $subtitle . '</div>'; } $divider = '<div class="page-header-divider"><i class="icon_pens"></i></div>'; $style = 'fancy-tabbed'; //standard, fancy-tabbed if ($style == 'fancy-tabbed') { $layout = '<div class="page-header %4$s"><div class="page-header-overlay"></div><div class="container">%3$s<div class="page-header-content"><div class="page-header-inner">%1$s %2$s</div></div></div></div>'; } else { $layout = '<div class="page-header %4$s"><div class="page-header-overlay"></div><div class="container"><div class="page-header-content">%1$s %2$s %3$s</div></div></div>'; } printf($layout, $title, $subtitle, $divider, $style . '-heading'); } }
function kt_get_page_header() { global $post; $show_title = false; if (is_front_page() && is_singular('page')) { $show_title = rwmb_meta('_kt_page_header', array(), get_option('page_on_front', true)); if (!$show_title) { $show_title = kt_option('show_page_header', 1); } } elseif (is_archive()) { $show_title = kt_option('archive_page_header', 1); } elseif (is_search()) { $show_title = kt_option('search_page_header', 1); } elseif (is_author()) { $show_title = kt_option('author_page_header', 1); } elseif (is_404()) { $show_title = kt_option('notfound_page_header', 1); } elseif (is_page()) { $post_id = $post->ID; $show_title = rwmb_meta('_kt_page_header', array(), $post_id); if (!$show_title) { if (is_page()) { $show_title = kt_option('show_page_header', 1); } elseif (is_singular('post')) { $show_title = kt_option('single_page_header', 1); } } } $show_title = apply_filters('kt_show_title', $show_title); if ($show_title == 'on' || $show_title == 1) { $title = kt_get_page_title(); $title = sprintf('<h1 class="page-title">%s</h1>', $title); $subtitle = kt_get_page_subtitle(); printf('<div class="page-header"><div class="container"><div class="page-header-content clearfix">%s</div></div></div>', $title . $subtitle); } }