{"id":85,"date":"2014-05-11T21:00:49","date_gmt":"2014-05-11T19:00:49","guid":{"rendered":"http:\/\/dev.bratched.fr\/en\/?p=85"},"modified":"2014-05-11T21:00:49","modified_gmt":"2014-05-11T19:00:49","slug":"creating-multilingual-websites-in-wordpress","status":"publish","type":"post","link":"https:\/\/bratched.com\/en\/2014\/05\/11\/creating-multilingual-websites-in-wordpress\/","title":{"rendered":"Creating multilingual websites in WordPress"},"content":{"rendered":"<p>The purpose of this post is to show a tutorial about creating a multilingual website in WordPress using the multisite feature.<\/p>\n<p>Advantages of the proposed solution :<\/p>\n<ul>\n<li>Lots of flexibility for content translation and presentation of the articles in different languages<\/li>\n<li>Different themes based on country<\/li>\n<li>Search Engine Optimization<\/li>\n<\/ul>\n<h1>Step 1 : Creating multisite WordPress<\/h1>\n<p>Add the following line in <strong>wp-config.php.<\/strong><\/p>\n<pre class=\"lang:default decode:true\">define ('WP_ALLOW_MULTISITE', true);<\/pre>\n<p>This will activate a new option in the Dashboard: Tools -&gt; Network Setup.<\/p>\n<p>All that&#8217;s left is to follow the instructions.<\/p>\n<p>Choose the default folder options in order to have urls of the following pattern www.monsite.com\/fr\/mapage.html<\/p>\n<p>2 actions are necessary :<\/p>\n<ul>\n<li>Copy\/Paste some code inside wp-config.php<\/li>\n<li>Copy\/Paste some code inside .htaccess<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>Note : make sure that the wp-config.php file has been updated between the first modification and the activation of the multisite.<\/p>\n<h1>Step 2 : Add sub-sites<\/h1>\n<p>Every sub-site will correspond to a specific language.<\/p>\n<p>Create as many sub-site as languages you need to support.<\/p>\n<p>Every code of the sub-site must correspond to 2 letters of the supported language.<\/p>\n<p><a href=\"http:\/\/dev.bratched.fr\/fr\/wp-content\/uploads\/sites\/2\/2014\/05\/Capture.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-588\" src=\"http:\/\/dev.bratched.fr\/fr\/wp-content\/uploads\/sites\/2\/2014\/05\/Capture-300x219.png\" alt=\"Capture\" width=\"370\" height=\"270\" \/><\/a><\/p>\n<p>Configure every sub-site with the corresponding language.<\/p>\n<h1>Step 3 : Add the plugin <strong>Multisite Language Switcher<\/strong><\/h1>\n<p>Go to the network administration and add the plugin MultiSite Language Switcher.<\/p>\n<p>This extension allows to relate categories, pages, articles, &#8230; with different languages.<\/p>\n<p>Activate this extension in every sub-site corresponding to a specific language.<\/p>\n<p>A widget allows to show the user a selection of languages on each page.<\/p>\n<p>To configure this widget go to Tools -&gt; Multi language Switcher<\/p>\n<h1>Step 4 : redirect based on the browser&#8217;s preferred language<\/h1>\n<p>This step could be achieved with the theme oncleben31-Multisite-Language-Switcher-Theme.<\/p>\n<p>Configure this theme on the main site so that the redirect to the sub-site is made automatically.<\/p>\n<p>Add and activate the theme from the network administration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The purpose of this post is to show a tutorial about creating a multilingual website in WordPress using the multisite feature. Advantages of the proposed solution : Lots of flexibility for content translation and presentation of the articles in different languages Different themes based on country Search Engine Optimization Step 1 : Creating multisite WordPress [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[270],"tags":[300,301,318],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/posts\/85"}],"collection":[{"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bratched.com\/en\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}