Advertisement
imranmodel32

Reptro Blog Page title Disable

Aug 3rd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.62 KB | None | 0 0
  1. <?php
  2.  
  3. if( !function_exists('reptro_page_title') ){
  4.     function reptro_page_title(){
  5.  
  6.         $title = get_the_title();
  7.  
  8.         if( is_search() ){
  9.  
  10.             if( reptro_is_search_has_results() ){
  11.                 $title = esc_html__( 'Search result', 'reptro' );
  12.             }else{
  13.                 $title = esc_html__( 'Nothing Found', 'reptro' );
  14.             }
  15.            
  16.         }elseif( is_singular( 'lp_course' ) ){
  17.             $terms = get_the_terms( get_the_id(), 'course_category' );
  18.             if( $terms && !empty($terms) ){
  19.                 $term = array_shift($terms);
  20.                 $title = $term->name;
  21.             }else{
  22.                 $title = esc_html__( 'Course', 'reptro' );
  23.             }
  24.         }elseif( reptro_lp_is_archive() ){
  25.             $title = esc_html( get_the_title( learn_press_get_page_id( 'courses' ) ) );
  26.         }elseif( is_singular( 'tribe_events' ) ){
  27.             $title = esc_html__( 'Events', 'reptro' );
  28.         }elseif( is_post_type_archive( 'tribe_events' ) ){
  29.             $title = esc_html__( 'Events', 'reptro' );
  30.         }elseif( is_archive() ){
  31.             $title = get_the_archive_title();
  32.         }
  33.  
  34.         if( is_page() ){
  35.             $need_page_title = reptro_get_post_meta( 'business_x_page_side_options', 'need_page_title', true, true );
  36.         }else{
  37.             $need_page_title = false;
  38.         }
  39.  
  40.         if( is_home() || is_singular( 'post' ) ){
  41.             $title = apply_filters( 'xt_blog_page_title', esc_html__( 'Blog', 'reptro' ) );
  42.         }
  43.  
  44.         if( is_404() ){
  45.             $title = apply_filters( 'xt_not_found_page_title', esc_html__( '404', 'reptro' ) );
  46.         }
  47.  
  48.         // Disable page header for home page
  49.         if( is_front_page() ){
  50.             $need_page_title = false;
  51.         }
  52.  
  53.         $need_page_title    = apply_filters( 'xt_theme_need_page_title', $need_page_title );
  54.         $title              = apply_filters( 'xt_theme_page_title', $title );
  55.         $xt_show_breadcrumb = apply_filters( 'xt_theme_show_breadcrumb', cs_get_option( 'xt_show_breadcrumb' ) );
  56.        
  57.  
  58.         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() ){
  59.             ?>
  60.                 <div class="xt-page-title-area">
  61.                     <div class="xt-page-title">
  62.                         <div class="container">
  63.                             <h1 class="entry-title"><?php echo wp_kses_post( $title ); ?></h1>
  64.                         </div>
  65.                     </div>
  66.                     <?php if( $xt_show_breadcrumb == true ): ?>
  67.                         <div class="xt-breadcrumb-wrapper">
  68.                             <div class="container">
  69.                                 <?php do_action( 'reptro_breadcrumb' );?>
  70.                             </div>
  71.                         </div>
  72.                     <?php endif; ?>
  73.                 </div>
  74.             <?php
  75.         }
  76.  
  77.     }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement