Search for Resources and Solutions

How to use the text from laguage files in a Midrub's theme

Please don't use the CodeIgniter's function to call the text from a language file. And please don't try to require the language files in a theme. Just put your language files in your theme directory -> language.

Then, to call a text string, please use the function get_the_string. The function get_the_string was created specially to work with the text files and the function works in two ways:

  • get_the_string('word_slug') - returns void
  • get_the_string('word_slug', true) - returns the string 

I'm using a lot get_the_string('theme_per_month') because it displays the text where i need. I'm using even get_the_string('theme_per_month', true) in a php code where is required return not echo.

Was this article helpful?