henkmensinga
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Plugins
In reply to: [Multisite Language Switcher] SEO links in headerThanks for cleaning up 😃
The hreflang alternate tags are for SEO purposes. Making Google and others understand the structure of the multilingual content.
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=2620865
Forum: Plugins
In reply to: [Multisite Language Switcher] SEO links in headerResolved
Forum: Plugins
In reply to: [Multisite Language Switcher] SEO links in headerOk, got this to work, thanks for your help!
function my_print_something() { foreach ( MslsBlogCollection::instance()->get() as $blog ) { $lang = $blog->get_language(); $mydata = MslsOptions::create(); switch_to_blog( $blog->userblog_id ); printf( '<link rel="alternate" hreflang="%1$s" href="%2$s" />', substr( $blog->get_language(), 0, 2 ), $mydata->get_permalink($lang) ); restore_current_blog(); } } add_action( 'wp_head', 'my_print_something' );Forum: Plugins
In reply to: [Multisite Language Switcher] SEO links in headerGot that.
Any idea about the individual urls?
Forum: Plugins
In reply to: [Multisite Language Switcher] SEO links in headerNot quite, but it’s a start.
You missed a , in the printf.
Languagecode are full like en_GB, but i just need en (which i can strip in the code I guess)
I need full urls to the blog and translations including current language.
So different for each blog item or page.Thanks so far!
Viewing 5 replies - 1 through 5 (of 5 total)