WordPress filter load_textdomain_mofile not working inside a child theme’s functions.php but works form inside a plugin

If you load a text domain in child theme, you may need call it in after_setup_theme filter which loads immediately after all the theme functions.php. You may refer to this note It could be due to the loading sequence. Since I haven’t seen it in your above code. I guess you load the text domain … Read more

Should all references to a text domain be to my current theme?

You can remove all the translation references if you don’t plan on translating it. You can also leave it in place, it shouldn’t hurt anything.. If you want to remove it, go through your theme files and find references to __(‘ Your Text’, ‘Domain’) and just change it to the “Your Text” portion. (Sometimes, you … Read more

WordPress Theme .mo-file won’t load

load_theme_textdomain() needs an absolute path to the directory, so you should set your THEME_URL like so define(“THEME_URL”, get_template_directory()); define(“TRANSLATION_URL”, THEME_URL . “/languages”); It wasn’t working for you because get_bloginfo(“template_url”) is an URL and not an absolute path on your server.

Does the textdomain have to be the theme’s name?

The text domain is a unique identifier, which makes sure WordPress can distinguish between all loaded translations so Using the basename of your plugin/theme is always a good choice because plugin/theme basename is always unique though it is not mandatory to have plugin/theme basename as text domain, you can use any unique identifier. If you’re … Read more

How can I see my theme’s text domain?

Your theme’s text domain is defined in your Theme Header in style.css. For example: /* * Plugin Name: My Plugin * Author: Otto * Text Domain: my-plugin */ The text domain should match your theme’s ‘slug’ (ie. the name of the folder where your theme is stored). Read more: https://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains