/** * Output page title. * * @param string $page */ function educator_page_title($page) { switch ($page) { case 'page': ?> <div id="page-title"> <?php the_title('<h1 class="entry-title">', '</h1>'); ?> <?php // Subtitle. $subtitle = apply_filters('edutheme_subtitle', ''); if (!empty($subtitle)) { echo $subtitle; } else { $subtitle = get_post_meta(get_the_ID(), '_educator_subtitle', true); if ($subtitle) { echo '<div class="subtitle">' . esc_html($subtitle) . '</div>'; } } ?> </div> <?php break; case 'index': ?> <div id="page-title"> <?php if (is_home() && 'posts' != get_option('show_on_front') && ($page_for_posts = get_option('page_for_posts'))) { echo '<h1>' . get_the_title($page_for_posts) . '</h1>'; // Subtitle. $subtitle = apply_filters('edutheme_subtitle', ''); if (!empty($subtitle)) { echo $subtitle; } else { $subtitle = get_post_meta($page_for_posts, '_educator_subtitle', true); if (!empty($subtitle)) { echo '<div class="subtitle">' . esc_html($subtitle) . '</div>'; } } } elseif (is_category()) { echo '<h1>' . sprintf(__('Category Archives: %s', 'ib-educator'), single_cat_title('', false)) . '</h1>'; $subtitle = apply_filters('edutheme_subtitle', ''); if (!empty($subtitle)) { echo $subtitle; } else { $term_description = term_description(); if (!empty($term_description)) { echo '<div class="subtitle">' . $term_description . '</div>'; } } } elseif (is_tag()) { echo '<h1>' . sprintf(__('Tag Archives: %s', 'ib-educator'), single_tag_title('', false)) . '</h1>'; $subtitle = apply_filters('edutheme_subtitle', ''); if (!empty($subtitle)) { echo $subtitle; } else { $term_description = term_description(); if (!empty($term_description)) { echo '<div class="subtitle">' . $term_description . '</div>'; } } } ?> </div> <?php break; case 'post_type_archive': ?> <div id="page-title"> <h1><?php post_type_archive_title(); ?> </h1> <?php echo apply_filters('edutheme_subtitle', ''); ?> </div> <?php break; case 'search': ?> <div id="page-title"> <h1> <?php printf(__('Search Results for: %s', 'ib-educator'), get_search_query()); ?> </h1> <?php echo apply_filters('edutheme_subtitle', ''); ?> </div> <?php break; case 'ibeducator': ?> <div id="page-title"> <h1><?php if (function_exists('ib_edu_page_title')) { ib_edu_page_title(); } elseif (is_post_type_archive(array('ib_educator_course', 'ib_educator_lesson'))) { post_type_archive_title(''); } ?> </h1> <?php echo apply_filters('edutheme_subtitle', ''); ?> </div> <?php break; case 'ib_educator_category': ?> <div id="page-title"> <h1><?php _e('Courses', 'ib-educator'); ?> </h1> <?php echo apply_filters('edutheme_subtitle', ''); ?> </div> <?php break; } }
<?php get_header('training'); ?> <?php /** * Add HTML before output of educator's content. */ do_action('ib_educator_before_main_loop', 'archive'); ?> <header class="page-header"> <h1 class="page-title"> <?php ib_edu_page_title(); ?> </h1> </header> <?php while (have_posts()) { the_post(); get_template_part('content', get_post_format()); } ?> <?php /** * Add HTML after output of educator's content. */