Skip Navigation

Resolved by author

Resolved in: Blocksy 2.0.26

Topic Tags: Compatibility

Overview of the issue

When you use the Contact info widget from Blocksy theme and WPML, even though the text within these widgets can be translated via WPML String Translation plugin, the changes aren’t reflected on the front end.

Workaround

Please, make sure of having a full backup of your site before proceeding.

Option 1

You can create a different widget per language, or:

Option 2

  • Open your theme’s functions.php file.
  • Add the following code:
    function filter_blocksy_contact_info_titles( $value ) {
    	if( is_array( $value ) ) {
    		$value[3]["ct_options"]["contact_information"][0]["title"] = apply_filters( 'wpml_translate_single_string', $value[3]["ct_options"]["contact_information"][0]["title"], 'blocksy-companion', $value[3]["ct_options"]["contact_information"][0]["title"] );
    		$value[3]["ct_options"]["contact_information"][1]["title"] = apply_filters( 'wpml_translate_single_string', $value[3]["ct_options"]["contact_information"][1]["title"], 'blocksy-companion', $value[3]["ct_options"]["contact_information"][1]["title"] );
    		$value[3]["ct_options"]["contact_information"][2]["title"] = apply_filters( 'wpml_translate_single_string', $value[3]["ct_options"]["contact_information"][2]["title"], 'blocksy-companion', $value[3]["ct_options"]["contact_information"][2]["title"] );
    	}
    	return $value;
    }
    add_filter( 'option_widget_blocksy_ct_contact_info', 'filter_blocksy_contact_info_titles', 10, 1 );
    
  • Go to WPML > String Translation page.
  • Scroll down to the Auto register strings for translation section and enable it, then click Edit. (Screenshot)
  • Select Blocksy in the text domains, then click Apply. (Screenshot)
  • Visit the homepage on the front-end.
  • Go back to WPML > String Translation and search for the strings again then translate them.
  • Disable the Auto register strings for translation option.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>