Skip to content

Instantly share code, notes, and snippets.

/yummy-pro-child
Created Oct 13, 2017

Embed
What would you like to do?
function yummy_pro_banner_image_title() {
$options = yummy_pro_get_theme_options();
if ( is_singular() ) {
$title = get_the_title();
} elseif( is_404() ) {
$title = esc_html__( '404', 'yummy-pro' );
} elseif( is_search() ){
$title = sprintf( esc_html__( 'Search Result for: %s', 'yummy-pro' ), get_search_query() );
} elseif ( is_archive() ) {
$title = get_the_archive_title();
} elseif ( is_home() && is_front_page() ) {
$title = ! empty( $options['blog_page_title'] ) ? $options['blog_page_title'] : esc_html__( 'Blogs','yummy-pro' );
} elseif ( is_home() ) {
$title = get_the_title( get_option( 'page_for_posts') );
}
if( ! empty( $title ) ): ?>
<div class="wrapper">
<div class="page-title-wrapper">
<h2 class="page-title">
<?php
if ( class_exists( 'WooCommerce' ) && ( is_shop() || is_tax( 'product_cat' ) ) ) {
woocommerce_page_title();
}
elseif ( class_exists( 'TP_Philosophy_Tools' ) && ( is_singular( 'tp-philosophy-testi' ) ) ) {
esc_html_e( 'Change the title here','yummy-pro' );
}
elseif ( class_exists( 'TP_Philosophy_Tools' ) && ( is_singular( 'tp-philosophy-teams' ) ) ) {
esc_html_e( 'Team Member','yummy-pro' );
}
else {
echo wp_kses_post( $title );
}
?>
</h2>
</div><!--.banner-title-->
</div><!-- .wrapper -->
<?php endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.