Overview of the Issue
When you use Cornerstone plugin (or PRO theme), custom CSS/JS from the original language is copied to the translated pages if WPML Media Translation plugin is active.
Workaround
This issue is fixed. Updating to the latest version solves it on your site, so you only need this workaround if you can’t update yet.
To fix this issue on your site and be able to have different custom CSS/JS on the translated pages, please follow these steps:
- Back up your website files and database.
- Add this code snippet to your theme’s functions.php file:
function wpml_compsupp_5527_wpml_pb_copy_meta_field( $value, $translated_post_id, $original_post_id, $meta_key ) { if ( '_cornerstone_settings' === $meta_key ) { return WPML_PB_Handle_Custom_Fields::slash_json( get_post_meta( $translated_post_id, $meta_key, true ) ); } return $value; } add_filter( 'wpml_pb_copy_meta_field', 'wpml_compsupp_5527_wpml_pb_copy_meta_field', 10, 4 );