DSchragg Posted September 7, 2010 Share Posted September 7, 2010 I currently have Wordpress 3.1 running in network mode so that I could have 1 site but in 2 languages. the url's are as follows: http://mysite.com/ - English http://mysite.com/fr - French I want to have a link embedded in the template that will say either French or English and when clicked take the user to the same page they are viewing but in the other language. All my pages and articles on both sites will have the same permalinks, so what I want to have is a link that will grab the current url or page being viewed and add the fr into the link automatically, so that I never have to manually update these links. Example: When viewing Page 1 English, the href would automatically provide a link to Page 1 in French, and update itself dynamically as you viewed different pages.. mysite.com/page1 turns into mysite.com/fr/page1 Is this possible? Thanks for everyones help. Link to comment https://forums.phpfreaks.com/topic/212808-capture-current-url-and-update-dynamically/ Share on other sites More sharing options...
petroz Posted September 8, 2010 Share Posted September 8, 2010 I am not sure if this is the best approach, but setting the language in the user session/cookie, would be my approach. Link to comment https://forums.phpfreaks.com/topic/212808-capture-current-url-and-update-dynamically/#findComment-1108538 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.