Examples used at http://msls.co/integration-snippets-and-examples/
Last active
August 29, 2015 14:06
-
-
Save lloc/21f15fa36e089340c124 to your computer and use it in GitHub Desktop.
Integration, snippets and examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blog = MslsBlogCollection::instance()->get_current_blog(); | |
$language = $blog->get_language(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_print_something() { | |
foreach ( MslsBlogCollection::instance()->get() as $blog ) { | |
printf( | |
'<link rel="alternate" hreflang="%1$s" href="http://%1$s.example.com/" />', | |
$blog->get_language() | |
); | |
} | |
} | |
add_action( 'wp_head', 'my_print_something' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment