Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG in Hreflang html tag and language switcher widget #44

Open
Overflow992 opened this issue Dec 6, 2019 · 0 comments
Open

BUG in Hreflang html tag and language switcher widget #44

Overflow992 opened this issue Dec 6, 2019 · 0 comments

Comments

@Overflow992
Copy link

I tried to edit the category base slug field using the following code:

add_filter( 'pll_translated_taxonomy_rewrite_slugs', function( $taxonomy_translated_slugs ) 
{
    $taxonomy_translated_slugs = array(

        // tax_name
        'category' => array(
            'it' => 'categoria',
            'en' => 'category',
        )

    );

    return $taxonomy_translated_slugs;
});

I updated the Permalinks and it seems that now when I change the language the slug in the url changes.

I noticed though that in the HTML code the HREFLANG tags have a problem, not showing the correct URL.

the correct URLs are:

IT: Mydomain.com/categoria/xxxxxxx

EN: Mydomain.com/en/category/yyyyyy

going to see the HREFLANG tags in the html code I find myself instead:

<link rel = "alternate" href = "Mydomain.com/xxxxxxx" hreflang = "it" />
<link rel = "alternate" href = "Mydomain.com/en/yyyyyy" hreflang = "en" />

So the slugs "category" and "category" are eliminated.

The links in the language switcher widget of Polylang also have the same problem.

Why not also update these elements?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant