Slug duplicates once clicking on link

Question

I have the current URL http://localhost/wordpress/en/ in my browser, once I click the link (code below) to change slug it changes the URL to http://localhost/wordpress/en/en/.

<a href="<?php echo get_home_url(); ?>/en/">English</a>

I want to keep http://localhost/wordpress/en/, and if there is another slug activated then change the en to whatever the new slug, instead adding another on it.

How can I prevent slug duplication on URL address?

0
Yotam 3 months 0 Answers 5 views 0

Leave an answer