Wordpress and php advise about a custom link
Posted on 2013-06-05
I think this is simple issue for a php programmer but is one that escapes me.
I am using a premium wordpress theme. It comes with its plugins and features. However, I need to use a plugin that translates the pages to another language. My current plugin will add a link to the matching translated url top of most free wordpress themes but will not, using this premium theme. I can add the widget to the column and footer but that looks very unappealing.
My best bet is to add a link in the header or page template that allows to echo the page url and add the dir /zh-tw/.
This way each page will have the corresponding translated url:
http://mydomain.com/zh-tw/<?php echo $current_page; ?>
So far the php code I have been able to find does not allow for a dir to be added. I end up with: