Incorrect alternate links in head with static front page
-
Since on my website, the static home page differs from the language taxonomy URL (<home-url>/<language-slug>/), I had to apply some little changes to the
frontend-links.php
file in order to get correct alternate links in the head section.--- frontend/frontend-links.php Wed Mar 25 09:28:47 2015 +++ frontend/frontend-links.php Sun Apr 05 18:08:25 2015 @@ -392,8 +392,11 @@ $url = $this->get_archive_url($language); } - elseif (is_home() || is_tax('language') ) + elseif ( is_home() ) $url = $this->get_home_url($language); + + elseif ( is_tax( 'language' ) ) + $url = esc_url( home_url( $language->slug . '/' ) ); $translation_url = apply_filters('pll_translation_url', (isset($url) && !is_wp_error($url) ? $url : null), $language->slug); $this->cache->set('translation_url:' . $language->slug, $translation_url);
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Incorrect alternate links in head with static front page’ is closed to new replies.