I made a custom theme named testTheme having these files:

The files of my theme

And I wanted to put some translation on it therefore I created the required .po and .mo files for greek language via poedit as seen in the following image:

Theme files

But I cannot make it load the custom translations I created via poedit. Do you have any idea how I will load them?

Edit 1

The functions.php as asked:



function loadThemerequirements()
    load_theme_textdomain( 'testTheme', get_template_directory() . '/languages' );


add_action( 'after_setup_theme', 'loadThemerequirements' );


The translations files were moved and renamed like that:

New translation files

Still Same result.

Edit 2:

This is not a child theme but a from-scratch made one.

Edit 3:

I tried renaming the .po and .mo files as el_GR.po and el_GR.mo still same result. I also tried to rename them in to testTheme/el_GR.po and testTheme/el_GR.mo without any success.

Update 2

The theme is in this git repository: https://github.com/pc-magas/testTheme

Edit 1

I changed my 404 page (that has some text to be translated into greek) like that:

<div class="fullpage_center">
        <p><?php _e('The requested page does not exist.','testTheme');?></p>
    wp_reset_query(); //resetting the page query

A sample of my page and the translated text is:

404 page with text that needs to be translated

As you can see still no result.

  • show us the code you use in functions.php to load the translations
    – mmm
    Commented Mar 25, 2017 at 22:19
  • 1. edit your translate file name from testTheme-el to testTheme-el_GR 2. set your textdomain in _e or __ functions
    – MahdiY
    Commented Mar 26, 2017 at 13:17

2 Answers 2

  1. Change your translate file name to el_GR.po and el_GR.mo:

    el_GR.po in: testTheme\languages\el.po
    el_GR.mo in: testTheme\languages\el.mo
  2. In 404.php file for print text you should write code like this (add textdomain):

    <?php _e('The requested page does not exist.', 'testTheme'); ?>

Second parameter is textdomain.

  • Do I need to reinstall my theme? I develop it straight through a wordpress installation without reinstalling or re-enabling. Commented Mar 26, 2017 at 17:44
  • 1
    No, just add textdomain to your strings
    – MahdiY
    Commented Mar 26, 2017 at 17:46
  • Also do I need to rename my theme's folder into testTheme-master currently is into folder testTheme Commented Mar 26, 2017 at 17:54
  • 1
    excuse me. template folder name is mistake! folder name not need rename.
    – MahdiY
    Commented Mar 26, 2017 at 17:58
  • But still I cannot get the translated text from the 404 page I get the English one. Commented Mar 26, 2017 at 18:10

If you have a child theme, in your function.php you have to change get_template_directory() by get_stylesheet_directory()

  • 1
    I do not have a child theme. It is a pure-made theme from scratch. Commented Mar 26, 2017 at 13:37
  • 2
    Do you see any parent theme in this picture?
    – MahdiY
    Commented Mar 26, 2017 at 13:39
  • Also I tried it and still no result. Commented Mar 26, 2017 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.