Path : /home/vishqocm/vishalwebtech.in/blog/wp-content/themes/katerio/functions/
File Upload :
Current File : /home/vishqocm//vishalwebtech.in//blog/wp-content/themes/katerio/functions/page-title.php

<?php
/**
 * Page Title
 *
 * @package Katerio
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! function_exists( 'th90_page_title' ) ) {

	function th90_page_title( $tag = 'h1', $echo = false ) {
		$title = get_the_title();
		$prefix = $subtitle = '';

		if ( is_tag() ) {
			$subtitle = esc_html__( 'Browsing Tag', 'katerio' );
			$title = single_tag_title( '', false );
		} elseif ( is_category() ) {
			$subtitle = esc_html__( 'Browsing Category', 'katerio' );
			$title = single_cat_title( '', false );
		} elseif ( is_author() ) {
			$title = '<span class="vcard">' . get_the_author() . '</span>';
		} elseif ( is_day() ) {
			$prefix = esc_html__( 'Day:', 'katerio' );
			$title = get_the_date( esc_html__( 'F j, Y', 'katerio' ) );
		} elseif ( is_month() ) {
			$prefix = esc_html__( 'Month:', 'katerio' );
			$title = get_the_date( esc_html__( 'F Y', 'katerio' ) );
		} elseif ( is_year() ) {
			$prefix = esc_html__( 'Year:', 'katerio' );
			$title = get_the_date( esc_html__( 'Y', 'katerio' ) ) ;
		} elseif ( is_search() ) {
			global $wp_query;
			$posts_found = $wp_query->found_posts;
			$subtitle = sprintf(
				esc_html__( '%1$s results for', 'katerio' ),
				$posts_found,
			);
			$title = esc_html__( 'Results for', 'katerio' ) . '&nbsp;&apos;' . get_search_query() . '&apos;';
		} elseif ( is_tax( 'post_format' ) ) {
			 if ( is_tax( 'post_format', 'post-format-aside' ) ) {
				 $title = esc_html__( 'Asides', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
				 $title = esc_html__( 'Galleries', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
				 $title = esc_html__( 'Images', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
				 $title = esc_html__( 'Videos', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
				 $title = esc_html__( 'Quotes', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
				 $title = esc_html__( 'Links', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
				 $title = esc_html__( 'Statuses', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
				 $title = esc_html__( 'Audio', 'katerio' );
			 } elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
				 $title = esc_html__( 'Chats', 'katerio' );
			 }
		 } elseif ( get_post_taxonomies() ) {
			 if ( th90_woo_check_page( 'is_shop' ) ) {
				/* Woocommerce shop title */
				$title = esc_html__( 'Shop', 'katerio' );
			} else {
				$title = single_cat_title( '', false );
			}
		} elseif ( is_post_type_archive() ) {
			$prefix = esc_html__( 'Archives:', 'katerio' );
			$title  = post_type_archive_title( '', false );

		} elseif ( is_tax() ) {
			$queried_object = get_queried_object();
			if ( $queried_object ) {
				$tax    = get_taxonomy( $queried_object->taxonomy );
				$title  = single_term_title( '', false );
				$prefix = sprintf(
					/* translators: %s: Taxonomy singular name. */
					esc_html__( '%s:', 'katerio' ),
					$tax->labels->singular_name
				);
			}
		}

		if ( $prefix ) {
			$title = $prefix . ' ' . $title;
		}

		$title = '<' . $tag . ' class="entry-title">' . $title . '</' . $tag . '>';

		if ( $echo ) {
			echo wp_kses_post( $title );
		} else {
			return $title;
		}
	}
}