WPML and a Child Theme
Translating Custom Parts of the OceanWP Child Theme with WPML
Using Ocean Extra, you can create custom templates in your OceanWP child theme. Learn how to make these custom templates multilingual with WPML.
What You’ll Need
- OceanWP child theme
- WPML core plugin and the WPML String Translation add-on
- Ocean Extra plugin.
To learn how to translate the OceanWP theme with WPML, see our page about how to turn OceanWP multilingual with WPML.
Translating Custom Templates Created in the OceanWP Child Theme
Ocean Extra makes it possible to create custom OceanWP templates by going to OceanWP > My Library. You can then go to Appearance > Customize and replace existing headers, footers, sidebars, and more with the custom templates you created.
Please note that if you are using the Ocean Extra plugin with the OceanWP theme, you need to follow a different translation process. To learn more, see the page about translating custom OceanWP templates with WPML..
To translate custom templates created in the OceanWP child theme:
1. Go to WPML > Settings. In the Post Types Translation section, make the My Library (oceanwp_library) post type Translatable. Remember to Save your changes.
2. Go to OceanWP > My Library and click the plus icon to translate the custom template in WPML’s Advanced Translation Editor. For the purpose of this example, we are translating the Custom Footer template.
3. When you’re done translating the custom template, use the language switcher in the top admin bar to switch to your secondary language. Make a note of the post ID for the custom template in the secondary language.
4. Go to WPML > String Translation and scroll down to the bottom of the page. Click on the Translate texts in admin screens link.
5. Using the search bar at the top of the Admin Texts Translation page, search for strings within the theme_mods_oceanwp-child-theme-master domain.
6. Check the box next to the texts you want to translate and click on the Add to String Translation button. In our case, we want to translate the ocean_footer_widgets_template.
7. Click on the Return to String Translation link. You should see the newly added texts at the top of the String Translation table. You can now click on the plus icon next to the default language template and add the post ID of the template in your secondary language.