2015-12-02 44 views
-1

嗨我正在使用Word新聞視覺作曲家..問題是,與一些頁面(並非所有網頁),前端編輯器不工作,它只是不斷加載,首先它wasn沒有與所有頁面一起工作..但是當我添加一個空白頁面時,Front編輯器與空白頁面和一些其他頁面一起工作,那麼如何使視覺作曲家前端編輯器與這些頁面一起工作? 我使用單詞按7主題。 這是我的痛苦:視覺作曲家前編輯器不工作

Example

回答

1

可能有許多原因,但根源是JS錯誤。 1.首先禁用頁面「preloader」並嘗試。 2.如果不工作,請嘗試禁用可能有js衝突的wordpress其他插件。 3.最好的方法:查看控制檯日誌中瀏覽器的開發人員工具中的js錯誤並修復它們。

+0

首先感謝您的回覆,如果你請告訴我如何請詳細說明,因爲我是初學者,仍在學習如何散步。我感謝您的幫助 –

1

我有視覺問題。在我的情況下,當我改變了經典模式並返回到後端編輯器時,我的情況有所幫助。

1

這個問題主要與composer-view.js,我面臨着同樣的問題,它得到了以下鏈接後解決 - visual-composer-templateget-is-not-a-functiVisual Composer is not working

您需要如下,以取代舊composer-view.js代碼。 (PS: - 更換此代碼之前備份您的舊文件) 您可以在以下位置 -

的wp-content /插件/ js_composer /資產/ JS /後端找到這個文件

老代碼

html2element: function (html) { 
     var attributes = {}, 
      $template; 
     if (_.isString(html)) { 
      this.template = _.template(html); 
      $template = $(this.template(this.model.toJSON(), vc.templateOptions.default).trim()); 
     } else { 
      this.template = html; 
      $template = html; 
     } 
     _.each($template.get(0).attributes, function (attr) { 
      attributes[ attr.name ] = attr.value; 
     }); 
     this.$el.attr(attributes).html($template.html()); 
     this.setContent(); 
     this.renderContent(); 
    } 

更換新如下 -

html2element:function (html) { 
      var attributes = {}, 
       $template; 
      if (_.isString(html)) { 
       this.template = _.template(html); 
      } else { 
       try { 
        this.template = _.template(html()); 
       } catch (err) { 
        this.template = html; 
       } 
      } 
      $template = $(this.template(this.model.toJSON()).trim()); 
      _.each($template.get(0).attributes, function (attr) { 
       attributes[attr.name] = attr.value; 
      }); 
      this.$el.attr(attributes).html($template.html()); 
      this.setContent(); 
      this.renderContent(); 
     } 

則同時更換渲染功能

舊代碼

render: function() { 
     var $shortcode_template_el = $('#vc_shortcode-template-' + this.model.get('shortcode')); 
     if ($shortcode_template_el.is('script')) { 
      this.html2element(_.template($shortcode_template_el.html(), 
       this.model.toJSON(), 
       vc.templateOptions.default)); 
     } else { 
      var params = this.model.get('params'); 
      $.ajax({ 
       type: 'POST', 
       url: window.ajaxurl, 
       data: { 
        action: 'wpb_get_element_backend_html', 
        data_element: this.model.get('shortcode'), 
        data_width: _.isUndefined(params.width) ? '1/1' : params.width, 
        _vcnonce: window.vcAdminNonce 
       }, 
       dataType: 'html', 
       context: this 
      }).done(function (html) { 
       this.html2element(html); 
      }); 
     } 
     this.model.view = this; 
     this.$controls_buttons = this.$el.find('.vc_controls > :first'); 
     return this; 
    } 

用新的代碼替換如下 -

render: function() { 
      var $shortcode_template_el = $('#vc_shortcode-template-' + this.model.get('shortcode')); 
      if ($shortcode_template_el.is('script')) { 
       var newHtmlCode = _.template($shortcode_template_el.html(), 
               this.model.toJSON(), 
               vc.templateOptions.default); 
       if(!_.isString(newHtmlCode)){ 
        newHtmlCode = $shortcode_template_el.html(); 
       } 
       this.html2element(newHtmlCode); 
      } else { 
       var params = this.model.get('params'); 
       $.ajax({ 
        type: 'POST', 
        url: window.ajaxurl, 
        data: { 
         action: 'wpb_get_element_backend_html', 
         data_element: this.model.get('shortcode'), 
         data_width: _.isUndefined(params.width) ? '1/1' : params.width, 
         _vcnonce: window.vcAdminNonce 
        }, 
        dataType: 'html', 
        context: this 
       }).done(function (html) { 
        this.html2element(html); 
       }); 
      } 
      this.model.view = this; 
      this.$controls_buttons = this.$el.find('.vc_controls > :first'); 
      return this; 
     }