3

I have a parent theme and a child theme, I would like to override the spanish .mo and .po files in the parent theme (or add them if they are not present in the parent theme) with the es_ES ones in my child theme. I added the folder with the modified mo and po files in the child theme with the same folder name as in the parent theme but this is not working. How can I come about this? Thanks!

| improve this question | | | | |
  • 3
    This is specifically covered in the codex. – vancoder Apr 10 '13 at 23:15
0
you may use this below code for your problem:

  [1]: https://i.stack.imgur.com/5aX1D.png
or use below code:
add_action( 'after_setup_theme', function () 
{

    load_theme_textdomain( 'your parent theme name', get_stylesheet_directory() . '/languages/' );

    load_child_theme_textdomain( 'your child theme name', get_stylesheet_directory() . '/languages' );
} );

| improve this answer | | | | |
-1

If you want to change more than just the stylesheet, your child theme can override any file in the parent theme: simply include a file of the same name in the child theme directory, and it will override the equivalent file in the parent theme directory when your site loads. For instance, if you want to change the PHP code for the site header, you can include a header.php in your child theme's directory, and that file will be used instead of the parent theme's header.php.

You can also include files in the child theme that are not included in the parent theme. For instance, you might want to create a more specific template than is found in your parent theme, such as a template for a specific page or category archive. See the Template Hierarchy for more information about how WordPress decides what template to use.

| improve this answer | | | | |
  • 1
    How does this answer the question?... – Pieter Goosen Aug 27 '15 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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