Skip Navigation

Open

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

To fix this issue on your site and be able to have different custom CSS/JS on the translated pages, please follow these steps:

  1. Back up your website files and database.
  2. 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 );
    

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>