Single String Translation
function swm_blog_text_translate($translated) {
$translated = str_ireplace('Blog', 'News', $translated);
return $translated;
}
add_filter('gettext', 'swm_blog_text_translate' );
The code above replaces Blog with News. You can use the example above and translate/change the text which is generated in the theme. ( e.g. Blog, Home, Search, About Author etc. )1. Add code snippet in the child theme's functions.php file. ( Child Theme Setup Video Tutorial )
2. Function name should be unique. In this example we used unique function name "swm_blog_text_translate".
2. Function name should be unique. In this example we used unique function name "swm_blog_text_translate".