-
-
Save billerickson/e5466b8680063918032866a5871c6653 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Load different homepage based on WPML language | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/load-different-template-based-on-language | |
* | |
* @param string $template | |
* @return string | |
*/ | |
function be_template_based_on_wpml( $template ) { | |
if( is_home() && ICL_LANGUAGE_CODE == 'cn' ) | |
$template = get_query_template( 'home-cn' ); | |
return $template; | |
} | |
add_filter( 'template_include', 'be_template_based_on_wpml' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment