请尝试此代码,希望它能解决您的问题。
add_filter( \'wp_title\', \'theme_custom_title\', 20 );
function theme_custom_title $title ) {
return str_replace(\'your old title\', \'your New title\', $title);
}
// changes the "Enter title here" to "Enter some New title"
add_filter(\'gettext\', \'custom_rewrites\', 10, 4);
function custom_rewrites($translation, $text, $domain) {
global $post;
$translations = &get_translations_for_domain($domain);
$translation_array = array();
switch ($post->post_type) {
case \'videofaqs\':
$translation_array = array(
\'Enter title here\' => \'Enter Video question here\'
);
break;
}
if (array_key_exists($text, $translation_array)) {
return $translations->translate($translation_array[$text]);
}
return $translation;
}