Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if( !function_exists('reptro_page_title') ){
- function reptro_page_title(){
- $title = get_the_title();
- if( is_search() ){
- if( reptro_is_search_has_results() ){
- $title = esc_html__( 'Search result', 'reptro' );
- }else{
- $title = esc_html__( 'Nothing Found', 'reptro' );
- }
- }elseif( is_singular( 'lp_course' ) ){
- $terms = get_the_terms( get_the_id(), 'course_category' );
- if( $terms && !empty($terms) ){
- $term = array_shift($terms);
- $title = $term->name;
- }else{
- $title = esc_html__( 'Course', 'reptro' );
- }
- }elseif( reptro_lp_is_archive() ){
- $title = esc_html( get_the_title( learn_press_get_page_id( 'courses' ) ) );
- }elseif( is_singular( 'tribe_events' ) ){
- $title = esc_html__( 'Events', 'reptro' );
- }elseif( is_post_type_archive( 'tribe_events' ) ){
- $title = esc_html__( 'Events', 'reptro' );
- }elseif( is_archive() ){
- $title = get_the_archive_title();
- }
- if( is_page() ){
- $need_page_title = reptro_get_post_meta( 'business_x_page_side_options', 'need_page_title', true, true );
- }else{
- $need_page_title = false;
- }
- if( is_home() || is_singular( 'post' ) ){
- $title = apply_filters( 'xt_blog_page_title', esc_html__( 'Blog', 'reptro' ) );
- }
- if( is_404() ){
- $title = apply_filters( 'xt_not_found_page_title', esc_html__( '404', 'reptro' ) );
- }
- // Disable page header for home page
- if( is_front_page() ){
- $need_page_title = false;
- }
- $need_page_title = apply_filters( 'xt_theme_need_page_title', $need_page_title );
- $title = apply_filters( 'xt_theme_page_title', $title );
- $xt_show_breadcrumb = apply_filters( 'xt_theme_show_breadcrumb', cs_get_option( 'xt_show_breadcrumb' ) );
- if( is_page() && $need_page_title != false || reptro_lp_is_archive() || is_singular( 'post' ) || is_singular( 'business_x_team' ) || is_singular( 'tribe_events' ) || is_singular( 'lp_course' ) || is_singular( 'product' ) || is_singular( 'business_x_gallery' ) || is_singular( 'elementor_library' ) || is_singular( 'sfwd-courses' ) || is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-quiz' ) || is_archive() || is_search() || is_404() ){
- ?>
- <div class="xt-page-title-area">
- <div class="xt-page-title">
- <div class="container">
- <h1 class="entry-title"><?php echo wp_kses_post( $title ); ?></h1>
- </div>
- </div>
- <?php if( $xt_show_breadcrumb == true ): ?>
- <div class="xt-breadcrumb-wrapper">
- <div class="container">
- <?php do_action( 'reptro_breadcrumb' );?>
- </div>
- </div>
- <?php endif; ?>
- </div>
- <?php
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement