From 79979931c19c501687d931fbe33d1b58aa32c7ac Mon Sep 17 00:00:00 2001 From: arttu Date: Wed, 13 Feb 2019 10:36:29 +0200 Subject: [PATCH 1/2] clear language slug for default language --- content/themes/custom/models/shared/header.php | 11 +++++++++-- .../themes/custom/partials/shared/search-section.dust | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/content/themes/custom/models/shared/header.php b/content/themes/custom/models/shared/header.php index dbf6716..ef832ad 100644 --- a/content/themes/custom/models/shared/header.php +++ b/content/themes/custom/models/shared/header.php @@ -8,10 +8,17 @@ public function Analytics() { /** * Get the slug for current language + * + * @return string */ - public function LangSlug() { + public function LangSlug() : string { $slug = pll_current_language(); - return $slug; + + if ( $slug !== pll_default_language() ) { + return $slug; + } + + return ''; } public function HomeUrl() { diff --git a/content/themes/custom/partials/shared/search-section.dust b/content/themes/custom/partials/shared/search-section.dust index dedda6b..36267c1 100644 --- a/content/themes/custom/partials/shared/search-section.dust +++ b/content/themes/custom/partials/shared/search-section.dust @@ -2,7 +2,7 @@