Created
November 22, 2015 11:31
-
-
Save celticwebdesign/0038f3a69e863492dbef to your computer and use it in GitHub Desktop.
WordPress Title - CPT / WPML / Yoast SEO
This file contains hidden or 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 if(is_post_type_archive('service')): | |
if( ICL_LANGUAGE_CODE == "zh-hans" ) { | |
// $language = "chinese"; | |
$page = 336; | |
} else { | |
// $language = "english"; | |
$page = 95; | |
} | |
echo "<title>".get_post_meta($page, '_yoast_wpseo_title', true)."</title>"; | |
elseif(is_post_type_archive('testimonial')): | |
if( ICL_LANGUAGE_CODE == "zh-hans" ) { | |
// $language = "chinese"; | |
$page = 683; | |
} else { | |
// $language = "english"; | |
$page = 686; | |
} | |
echo "<title>".get_post_meta($page, '_yoast_wpseo_title', true)."</title>"; | |
else: | |
echo "<title>".get_post_meta($post->ID, '_yoast_wpseo_title', true)."</title>"; | |
endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment