• 2020-03-01
  • 2020-03-01

How to Localize the site title and catch phrase with THE THOR WP Theme and the Bogo plugin

This blog have been using the wordpress theme “THE THOR”. The other language version is also created and to localize with plugin “Bogo”. The Bogo has a function to replace text but the site title and the catch phrase couldn’t replace, so they had been exported in Japanese because the main language of this blog is Japanese. I want to replace them too so I had edit the functions.php of the child theme. At last, the site title and the catch phrase now to be localized. This article explains that how to do it. The way in this article, edit the file of the child theme. Please backup the file before edit them. Generating the site title string THE THOR implements the hook function of the pre_get_document_title to generate the site title string. I found the fit_title_document() function in the the-thor/inc/seo/title.php file. Override this function. Override the hook function in the child theme It is dangerous that you edit the file in the parent theme, so implement the hook function in the child theme. Edit the the-thor-child/functions.php file. Generating the site title tag string Add the following code into the the-thor-child/functions.php file. function localize_title() { ob_start(); bloginfo('name'); $localizedName = ob_get_clean(); […]