A talk by @thorstenfrommen
The multisite-based free open source plugin for 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 at wp-admin/network.php
:
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 any 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.
You now have two related categories, and thus translations of each other.
Add a new category.
On the other site now, add a new category, and select the according translation.
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.
By publishing, two related posts will be created. One on each site.
Create a new menu, enable the Languages meta box, and add menu items.
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 Quicklinks on the MultilingualPress settings page.
Choose your desired Quicklink position, and save your changes.
The front-end display of the Quicklinks on a post.
On the Sites page, you can see the redirect setting for each site.
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 a translation, and save your changes.
Well, … just go ahead and delete the post.
In your Personal Options, 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...
}