[Plugin: Polylang] How to translate/switch specific contents on templates
-
Hi!
As I said before, the plugin is working perfect for me, but I have a question:
I’m translating most of the content of my site using different Widgets for each language (combining them with Rich Widget and other stuff), but there are some elements that require a direct translation on my theme/template, for example, a slideshow that I’m using on the home page.
For now, particulary on the home page, I’ve managed to use a different slideshow using this function:
<?php $homepage = "/en/"; $currentpage = $_SERVER['REQUEST_URI']; if($homepage==$currentpage): ?> <div>The slideshow with images in English</div> <?php else: ?> <div>The slideshow with images in Spanish</div> <?php endif; ?>
…but that just works well for me on the home page.
Is there any way to set a function to show different contents on my templates depending on the language selected by the user, using a function like the one from above?
And I have a second question: Why don’t you add a “Donate” button (using something like Paypal) inside the settings page of the plugin? I would be more than happy to collaborate in order to maintain the plugin alive. I don’t have too much money (and there are odd rules to control foreign currency in my country) but I could spend at least $10 each time that I use your plugin (right now, I’m using it in two projects).
Thanks again!
- The topic ‘[Plugin: Polylang] How to translate/switch specific contents on templates’ is closed to new replies.