From a69388ebe3c7b4be5eb75e22aee104cb327b5701 Mon Sep 17 00:00:00 2001 From: Ivaylo Markov Date: Mon, 16 Oct 2023 22:11:24 +0300 Subject: [PATCH] Title fixes --- functions.php | 18 ++++++++++++++++++ header.php | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 943911d..61b1818 100644 --- a/functions.php +++ b/functions.php @@ -379,3 +379,21 @@ if (function_exists("pll_register_string")) { pll_register_string('feedback','Submit feedback'); pll_register_string('about_event','about_event'); } + +add_filter( 'wp_title', 'wpdocs_hack_wp_title_for_home' ); + +/** + * Customize the title for the home page, if one is not set. + * + * @param string $title The original title. + * @return string The title to use. + */ +function wpdocs_hack_wp_title_for_home( $title ) +{ + if ( empty( $title ) && ( is_home() || is_front_page() ) ) { + $title = get_bloginfo('name') . ' | ' . get_bloginfo( 'description' ); + } else { + $title = $title . get_bloginfo( 'tagline' ); + } + return $title; +} diff --git a/header.php b/header.php index 18df87c..6c25726 100644 --- a/header.php +++ b/header.php @@ -13,9 +13,9 @@ - + - <?php is_front_page() ? (bloginfo('name').e_(' | ').e_('Да споделим свободата')) : wp_title( ' | ', true, 'right' ); ?> + <?php wp_title( ' | ', true, 'right' ) ?>