This wordpress plugin accomplish five purposes:
- Create a Gutenberg Shortcode access to Polylang strings, so you can use it anywhere. This include Oxygen templates!
- Register new strings to translate without the need to edit functions.php nor installing a pluging to launch snippets.
- Load custom CSS and JS files in WordPress but withouth editing functions.php.
- Create a Gutenberg Shortcode access to add a Language switcher.
- Customize the Language switcher.
- Register a condition that you can use in Oxygen to show/hide content based on the language string in the URL.
If you are wondering what's the problem with functions.php: Oxygen doesn't make use of functions.php since this builder desactivate wordpress themes. So if you need to add PHP functions, you have to put it in a plugin.
I created this plugin because I wanted a simple way to manage the translation and customization of my website without adding a third-party plugin to handle code snippets.
This plugin is based in the code of the following good people:
Thank you.
- Click on the
Download ZIP
button at the right to download the plugin. - Go to Plugins > Add New in your WordPress admin. Click on
Upload Plugin
and browse for the zip file. - Activate the plugin.
Edit plugin.php
and use the commented sample code as an example to register new Polylang strings, add enqueue or other site-specific code.
Use shortcode [polylang_langswitcher]
to add a language switcher.
Use [pll_translate text="$text"]
or [pll_translate text="$text" lang="$lang"]
to add Polylang strings to anywhere.
- Initial Release
- Create Oxygen condition by language.
- Create Language switcher that can be use by shortcode.
- CSS to modify the look of the Language switcher.
- Enqueue CSS and JS