0

So I'm having trouble finding a way to translate the homepage content on a few pages I manage.

They can be found here:

  1. KorgCanada.com (Theme is Simplecorp, and the support forum offers no help)
  2. EriksonMusic.com (Theme is target, and again, absolutely no help)

I'm using the Poplarware Language Switcher plugin which is an outdated/ no longer maintained plugin for translating pages/ posts etc. It functions by using tags like [lang_en] English goes here [/lang_en][lang_fr] French here [/lang_fr].

And it's working perfectly for all my pages/ posts, EXCEPT for the dynamically generated homepages of both the sites, which is made up of the "Theme options" tabs within the GUI. If I put those tags in the text areas for those, they show up as plain text, and don't actually translate anything.

I was hoping somebody could help me regulate this, preferably while using the same plugin, and perhaps just making a page template of the homepage, and hard-coding the French version myself... but I'm totally uncertain about how to go about this. If you have any ideas how I can accomplish this, please lend me a hand, I'm getting very desperate.

1 Answer 1

0

The plugin you have installed hooks into the_content() function which is called within the post loop on your posts - this is why it works there and not the text only widgets. You may find a PHP widget will work OR you can use PHP to run your shortcode using the do_shortcode function.

PHP widget plugin: http://wordpress.org/plugins/php-code-widget/

Shortcode example:

<? echo do_shortcode('[lang_en] English goes here [/lang_en]'); ?>

2
  • Thanks so much for the reply, this sounds intriguing indeed.... Can you give me more concise info on how to accomplish this ? Would the aforementioned shortcode let me be able to input text directly into the same GUI's textbox, but I'll be able to put the english AND french txt there ? Looking forward to hearing back from you, Commented Nov 15, 2013 at 13:37
  • Hey Innate, so after some hacking & slashing around, I've come to realize that my best option is probably just to make a custom homepage template, which has both the english and french content on it, within the [lang] tags, like your 2nd suggestion mentions. However, I tried to implement the code: <? echo do_shortcode('[lang_en] English goes here [/lang_en]'); ?> into my page template, but it still shows up as [lang_en], and doesn't function as expected... Any further instruction on this type of configuration would be greatly appreciated. Thanks in advance, hope you can help me out :) Commented Nov 15, 2013 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.