Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1355257
    walda
    Participant

    Hi

    I think i have the same proble as https://community.theme.co/forums/topic/translate-custom-sidebar-menu-with-wpml/

    I’ve started translating duplicate pages to be able to use cornerstone in the future. I get this message above:

    Warning: You are trying to edit a translation with the standard WordPress editor, but your site is configured to use the WPML Translation Editor.

    there are pages in my website which has a secondary sidebar menu to navigate. But it dissasapears at duplicated translated page (spanish/english). http://institutomalave.com/reproduccion-asistida/

    Dou you think i can keep my sidebar menu if i use the translation editor instead duplicate pages an edit one by one?

    Thanks!

    #1355527
    Rupok
    Member

    Hi there,

    Thanks for writing in! I am not sure and I think it won’t depend on the theme. You can reach the WPML support for better clarification.

    Cheers!

    #1355890
    walda
    Participant

    Hi. WPML support solved my problem. They told me that x theme has an issue with the sidebars widget an it cannot be translated. They contacted to your people and you told them this will be solved at next release of x theme

    I copy the trick:

    In the wp-content / themes / x / framework / functions / global / admin / sidebars.php file, replace the “ups_display_sidebar ()” function with the following:

    
    function ups_display_sidebar( $default_sidebar ) {
     
      $q_object = get_queried_object();
     
      $sidebars = get_option( 'ups_sidebars' );
     
      foreach ( $sidebars as $id => $sidebar ) {
        if ( is_singular() ) {
          if ( array_key_exists( 'pages', $sidebar ) ) {
            if ( array_key_exists( 'children', $sidebar ) && $sidebar['children'] == 'on' ) {
              $child = array_key_exists( $q_object->post_parent, $sidebar['pages'] );
            } else {
              $child = false;
            }
            $page_id = $q_object->ID;
            $current_lang= apply_filters( 'wpml_current_language', NULL );
            $default_lang= apply_filters( 'wpml_default_language', NULL );
            if ($current_lang != $default_lang)
            {
              $page_id = apply_filters('wpml_object_id',$page_id, 'page', false, $default_lang );
            }
            if ( array_key_exists( $page_id, $sidebar['pages'] ) || $child ) {
              return $id;
            }
          }
        } elseif ( is_home() ) {
          if ( array_key_exists( 'index-blog', $sidebar ) && $sidebar['index-blog'] == 'on' ) {
            return $id;
          }
        } elseif ( is_tax() || is_category() || is_tag() ) {
          if ( array_key_exists( 'taxonomies', $sidebar ) ) {
            $tax_id = $q_object->term_id;
            $current_lang= apply_filters( 'wpml_current_language', NULL );
            $default_lang= apply_filters( 'wpml_default_language', NULL );
            if ($current_lang != $default_lang)
            {
              $tax_id = apply_filters('wpml_object_id',$tax_id, 'category', false, $default_lang );
            }
            if ( array_key_exists( $tax_id, $sidebar['taxonomies'] ) ) {
              return $id;
            }
          }
        } elseif ( x_is_shop() ) {
          if ( array_key_exists( 'index-shop', $sidebar ) && $sidebar['index-shop'] == 'on' ) {
            return $id;
          }
        }
      }
     
      return $default_sidebar;
     
    }
    
    
    #1355923
    walda
    Participant

    After adding this, I tried to modify order of some elements of the main menu (not sidebar), try to save menu and an internal error occurs. I have reviewed the logs and this is the error:

    [Fri Feb 03 01:21:14 2017] [warn] mod_fcgid: read data timeout in 60 seconds
    [Fri Feb 03 01:21:14 2017] [error] [client 83.41.4.40] Premature end of script headers: php5.cgi, referer: http://institutomalave.com/wp-admin/nav-menus.php

    I only happen when trying to record changes in the original language. When I change the menu of the version in another language no error occurs.

    What could be the reason Is it relative to the changes I have made or a problem with my hosting?

    thanks

    #1356324
    Rupok
    Member

    Hi there,

    Looks like the error is specific to mod_fcgid. Your hosting provider might help on this. Here I got a solution (at bottom) that you can try – http://expressionengine.stackexchange.com/questions/7467/mod-fcgid-read-data-timeout-in-45-seconds-premature-end-of-script-headers

    Cheers!

    #1356564
    walda
    Participant

    Yes. I contacted the hosting. They have upgraded the php version to a higher one and the problem has disappeared. It was obsolete.

    Thanks

    #1356776
    Rahul
    Moderator

    Glad to hear it!

    Let us know if we can help with anything else.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1355257 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>