WordPress Multilingual Theme using Multisite

Have you added the Function load_theme_textdomain to the theme? so if you have them themes .mo files in theme/mytheme/languages Loads the theme’s translated strings: add_action(‘after_setup_theme’, ‘my_theme_setup’); function my_theme_setup(){ load_theme_textdomain(‘my_theme’, get_template_directory() . ‘/languages’); } Put this in your functions.php

Is there a plugin that will facilitate displaying a website (static pages, not a blog) content in two languages [closed]

As far as I know of translating plugins, in all of them you’ll have two sets of content (or more), one for each language: qTranslate: free, creates new input fields for the title, and additional tabs for the content. They are all handled in the same post/page screen. WPML: premium, creates a ‘mirror’ post/page for … Read more

Multi language site with same content

Storing it in a session would certainly be possible, but is not necessary at all. Unless you’re looking for a way to not include the query string in subsequently visited URLs. Here I’d rather go with a cookie than a session, since WP already relies on cookies and does not use sessions. But that’s a … Read more

How to use rewrite rule or rewrite endpoint to switch languages?

You cannot do this by just adding a rewrite rule, you need to change every recorded rules. Here is a simple way to do this: function my_rewrite_rules($rules) { $new_rules = array(); $new_rules[‘(?:de|en)/?$’] = ‘index.php’; foreach ($rules as $key => $val) { $key = ‘(?:de|en)/?’ . $key; $new_rules[$key] = $val; } return $new_rules; } add_filter(‘rewrite_rules_array’, ‘my_rewrite_rules’, … Read more

‘Trick’ a plugin (WP-Members) to think the blog language has changed for a single page

Yes, sort of. Any localized plugin such as WP-Members runs off of the “locale” that WordPress is set to. This value can be filtered for WP as a whole using the locale filter. But it can also be filtered for plugins using plugin_locale See: https://developer.wordpress.org/reference/hooks/plugin_locale/ To use plugin_locale specific to the text domain for the … Read more