2017-04-06 77 views
0

我試圖卸載並重新安裝視覺作曲家,我似乎無法修復它,我無法編輯前端,因爲它根本沒有顯示。我安裝了ken主題。當檢查控制檯時,我得到這個錯誤,但是我在編程中幾乎沒有到期,我不知道該怎麼做。Wp視覺編輯器沒有顯示

Uncaught TypeError: $template.get is not a function 
    at n.html2element (composer-view.js:146) 
    at n.render (composer-view.js:157) 
    at n.appendShortcode (composer-view.js:534) 
    at n.<anonymous> (composer-view.js:477) 
    at load-scripts.php:112 
    at Function.m.each.m.forEach (load-scripts.php:112) 
    at n.addChild (composer-view.js:476) 
    at n.addAll (composer-view.js:470) 
    at _ (load-scripts.php:457) 
    at m (load-scripts.php:457) 

請幫忙。

回答

1

這基本上意味着你必須更新視覺作曲家。我也遇到很多問題。有不同的選項可以通過修改visual composer文件中的代碼來解決這個問題,這是不推薦的。所以我個人建議你親切地更新你的視覺作曲家,然後它完美的作品。

文件來修改網址是:

/wp-content/plugins/js_composer/assets/js/dist/backend.min.j‌​s 

代碼替換爲:

html2element: function(html) { 
     var $template, attributes = {}, 
      template = html; 
     $template = $(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() 
    }, 

請只改變 「html2element」 功能。希望這對你有用。

感謝

+0

的事情是我在artbees提供的最新版本,需要爲主題的工作女巫,我能做些什麼代碼修改? – Aimatos

+0

代碼修改應該在模板文件,這是安靜的,我認爲不好。看到我修改後的答案。 –

+0

似乎找不到該文件,我的文件夾名稱是js_composer_theme/assets/js,但我沒有dist文件夾,我有一個名爲backend的文件夾,裏面有很多文件,但我不想編輯任何文件如果我不知道女巫是誰 – Aimatos