Code function translates custom themes in wordpress

Currently many wordpress are very diverse, also a lot of themes, and many different languages, if you are IT IT, you can go to code to edit and replace words, but many of you do not know the code, every time you want to change the word at will not know how to curious!

So I made this article to let you change it easier, without having to dig into the code


You copy this code into the theme's Function.php file,

function my_custom_translations( $strings ) {
$text = array(
   'Chữ cần thay' => 'nội dung muốn thay',
    $strings = str_ireplace( array_keys( $text ), $text, $strings );
    return $strings;
add_filter( 'gettext', 'my_custom_translations', 20 );

That's it, ctrl + f5 and enjoy!

The post Code function translates the customized theme in wordpress appeared first on the Blog Community.

Read more :
READ  How to add a recent post widget in Blogger

Leave a Reply

Your email address will not be published. Required fields are marked *