%s

', esc_html( get_bloginfo( 'description' ) ) ) : ''; if ( ! $site_title && ! $tagline ) { return; } ?>

'', ); // If it's a 404 page, use a "Page not found" title. if ( is_404() ) { $title['title'] = __( 'Page not found', 'cuisine-palace' ); // If it's a search, use a dynamic search results title. } elseif ( is_search() ) { /* translators: %s: Search query. */ $title['title'] = sprintf( __( 'Search Results for “%s”', 'cuisine-palace' ), get_search_query() ); // If on the front page, use the site title. } elseif ( is_front_page() ) { $title['title'] = get_bloginfo( 'name', 'display' ); // If on a post type archive, use the post type archive title. } elseif ( is_post_type_archive() ) { $title['title'] = post_type_archive_title( '', false ); // If on a taxonomy archive, use the term title. } elseif ( is_tax() ) { $title['title'] = single_term_title( '', false ); /* * If we're on the blog page that is not the homepage * or a single post of any post type, use the post title. */ } elseif ( is_home() || is_singular() ) { $title['title'] = single_post_title( '', false ); // If on a category or tag archive, use the term title. } elseif ( is_category() || is_tag() ) { $title['title'] = single_term_title( '', false ); // If on an author archive, use the author's display name. } elseif ( is_author() && get_queried_object() ) { $author = get_queried_object(); $title['title'] = $author->display_name; // If it's a date archive, use the date as the title. } elseif ( is_year() ) { $title['title'] = get_the_date( _x( 'Y', 'yearly archives date format', 'cuisine-palace' ) ); } elseif ( is_month() ) { $title['title'] = get_the_date( _x( 'F Y', 'monthly archives date format', 'cuisine-palace' ) ); } elseif ( is_day() ) { $title['title'] = get_the_date(); } // Add a page number if necessary. if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { /* translators: %s: Page number. */ $title['page'] = sprintf( __( 'Page %s', 'cuisine-palace' ), max( $paged, $page ) ); } $sep = '-'; $title = implode( " $sep ", array_filter( $title ) ); return $title; } if ( ! function_exists( 'cuisine_palace_get_banner_title' ) ) { /** * Prints the sanitized html for current page banner title. * ! Do not use it as the_title() alternative. * * @uses is_archive() * @uses is_singular() * @uses get_the_archive_title() * @uses cuisine_palace_doc_title() * @uses the_title() * * @param string $before Element before the title. * @param string $after Element after the title. * @param string $echo Print or return the html. */ function cuisine_palace_get_banner_title( $before = '', $after = '', $echo = true ) { $title = is_archive() ? get_the_archive_title() : cuisine_palace_doc_title( '', false ); /** * If we are in single page or post then use the default the_title() function for better formatting. */ if ( is_singular() ) { $title = the_title( '', '', false ); } if ( ! $title ) { return; } if ( ! $echo ) { return $before . $title . $after; } echo wp_kses_post( $before . $title . $after ); } } if ( ! function_exists( 'cuisine_palace_get_breadcrumb' ) ) { /** * Returns the html for breadcrumbs if $echo is provided false else prints it. * * @param bool $echo Echo or return the html. */ function cuisine_palace_get_breadcrumb( $echo = true ) { if ( ! class_exists( 'Cuisine_Palace_Breadcrumb_Trail' ) ) { require_once get_template_directory() . '/inc/classes/class-cuisine-palace-breadcrumb-trail.php'; } $breadcrumb = ''; $use_yoast_breadcrumbs = function_exists( 'yoast_breadcrumb' ) && yoast_breadcrumb( '', '', false ) ? true : false; $args = array( 'container' => 'div', 'show_on_front' => false, 'show_browse' => false, 'echo' => false, ); $is_showable = cuisine_palace_breadcrumb_trail( $args ); $breadcrumb .= ''; if ( $use_yoast_breadcrumbs ) { /** * Add support for yoast breadcrumb. */ $breadcrumb .= yoast_breadcrumb( '
', '
', false ); } else { if ( $is_showable ) { $breadcrumb .= '
'; $breadcrumb .= '
'; $breadcrumb .= cuisine_palace_breadcrumb_trail( $args ); $breadcrumb .= '
'; $breadcrumb .= '
'; } } $breadcrumb .= ''; if ( ! $echo ) { return $breadcrumb; } echo $breadcrumb; // phpcs:ignore } } if ( ! function_exists( 'cuisine_palace_get_the_author' ) ) { /** * Prints the html with the author info and author archive link. */ function cuisine_palace_get_the_author() { $author_id = get_the_author_meta( 'ID' ); if ( ! $author_id ) { return; } $author_name = get_the_author_meta( 'display_name' ); $author_posts = get_author_posts_url( $author_id ); ?>