Limit language switching only to the Posts page
-
Hi, I am looking to limit the language switching to only the Posts page, so if a user clicks on another menu item in the main site menu that it will *not* automatically include the language string in the url.
As an example, if I have a site with a menu structure like “Home”, “About”, “News”, then when a user is on the “News” (Posts) page they can change language to Spanish and the link to “News” would be “/es/news/” but the other main menu links would stay as only “/about/” and not include the language prefix.
Is there any specific way of limiting the addition of the language string within the plugin? I know I could add some custom code to check whether we are on the main Posts archive page and limit it but it seems like I’d need to start to parse the menu structure output which is starting to get a little more complex than I’d prefer.
- The topic ‘Limit language switching only to the Posts page’ is closed to new replies.