Products related to Shortcode
Discussions related to Shortcode
Step by step implementation of Language Switcher in a single wordpress website
If you are implementing Language Switcher in a single wordpress installation this step by step guide is for you. Single website implementation is recommend for small website or when you only need to translate the content section but you keep the same global settings. Let’s first do the global setup > Go to yourwebiste.net/wp-admin/admin.php?page=language-switcher > Make sure you have checked English and your second language then save. > After that move to the Tab called “Settings” and check Post and Page in the post types. You can come back to the bellow section “Default URLs” once you have created your home pages for both languages. Create a translated page > From the dashboard add a new Page and put your translated content with the shortcode [language-switcher] at the beginning of the text. > Select the language of this page in the sidebar and copy/paste the url of the english version in the english url section. > Save your page and check the preview. You should see a language selector at the beginning of the content with the english url. > Now edit the english page, mark it as english, copy/paste the url of the translated page in the according section… Read More
How to integrate the language selector in a WordPress site?
There is 3 ways to integrate the switcher in your site. 1 – If you need to add the language switcher in your site you can use the widget or the shortcode [language-switcher]. The shortcode also works inside post contents if you need to show the switcher only for some pages. 2 – To add the languages in your menu you can check the menus from the backend in Languages > Settings > Show in Navigation Menus 3 – To add the shortcode directly in your theme you can use the following PHP code: <?php echo do_shortcode('[language-switcher]'); ?>
How to implement Language Switcher in WordPress?
The Language Switcher allows you to add dropdown list of urls pointing to a translated version of the current page. This plugin do not provide translation features or multi-version like WPML or Weglot. You can totally use it together with WPML or Weglot however we strongly recommend you to keep all languages separated from each other by simply implementing one WP site per language and use the language switcher as navigation tool between all the installations, like wikipedia does in its sidebar. If you chose to implement multi-language from the same site without any other translation plugin the plugin will take care of switching the default language of the site depending on the language of the current url. It means that when you will be reading the spanish version for example, the auto generated contents (date, plugin translations, core translations…) will also be shown in spanish. Following the same logic the Menu will filter only the spanish urls and the WP_Query will show only spanish contents in the case tag clouds and list of categories. Once you activate the post types (post, page, product….) and/or taxonomies (tag, category, attribute…) in the Language settings you can then add language urls when… Read More