A talk by @thorstenfrommen
The multisite-based free open source plugin for your multilingual websites.
hreflang
information:
“A multisite network is a collection of sites
that all share the same WordPress installation.”“The individual sites […] do not have their own directories on your server,
although they do have separate directories for media uploads […],
and they do have separate tables in the database.” WordPress Codex
wp-config.php
file:
define( 'WP_ALLOW_MULTISITE', true );
Just put it somewhere before the first require
statement.
As Administrator, go to Tools › Network Setup:
wp-config.php
File
WP_ALLOW_MULTISITE
constant:
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'domain.tld' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
.htaccess
File
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
Go to the Plugins page in your Network Admin, and activate MultilingualPress.
That’s it already. MultilingualPress can be used without further plugin settings.
Edit your existing site.
Set the site language.
Add a new site.
Change the relationship, select an existing post, and save your changes.
You now have two related posts, and thus translations of each other.
Edit a category, select a translation, and save your changes.
Add a new English category as translation of an existing German one.
Go to the Add New Event page, … and be confused.
Go to the MultilingualPress settings page, and enable translation of Events.
Add a new event, for real this time.
Create a copy of the original post for the other site.
When publishing, two related posts will be created; one on each site.
Create a new menu, enable the Languages meta box, and add Languages.
Save the menu.
The front-end display of the menu totally depends on the theme, of course.
Add the Language Switcher widget to a sidebar, and choose your desired settings.
The front-end display of the widget, again, depends on the theme.
Activate the Quicklinks module on the MultilingualPress settings page.
Choose your desired position, and save the changes.
The front-end display of the Quicklinks on a single post.
On the Sites page, you can see the Redirect setting for each site.
Individually enable automatic redirection in the MultilingualPress settings tab for each site.
Confirm the Redirect setting for each site.
Add a new site, based on an existing one.
Confirm the site settings.
Edit a post, remove the relationship with the current translation, and save the changes.
Well, … just go ahead and delete the post.
In Your Profile, choose your preferred language for the Admin UI for all sites.
function some_hooked_function() {
// Bail if this is a multisite installation and the site has been switched.
if ( is_multisite() && ms_is_switched() ) {
return /* something, maybe */;
}
// Regular function code...
}