如何删除内置主题 Visual Composer 模块并安装插件?

How to remove the built-in theme Visual Composer module and install the plugin instead?

wordpress 上有一个网站,主题是在模块设计器 WPBakery Visual Composer 中构建的。它有一个问题 - 有些元素有 与 wordpress 的新版本冲突,因为它已经过时了。 问题:如何取消停靠主题的内置设计器并设置Visual Composer 插件。 这是主题 functions.php 设计器中调用的代码:

if (!class_exists('WPBakeryVisualComposerAbstract')) {
  $dir = dirname(__FILE__) . '/wpbakery/';
  $composer_settings = Array(
      'APP_ROOT'      => $dir . '/js_composer',
      'WP_ROOT'       => dirname( dirname( dirname( dirname($dir ) ) ) ). '/',
      'APP_DIR'       => basename( $dir ) . '/js_composer/',
      'CONFIG'        => $dir . '/js_composer/config/',
      'ASSETS_DIR'    => 'assets/',
      'COMPOSER'      => $dir . '/js_composer/composer/',
      'COMPOSER_LIB'  => $dir . '/js_composer/composer/lib/',
      'SHORTCODES_LIB'  => $dir . '/js_composer/composer/lib/shortcodes/',
      'USER_DIR_NAME'  => 'extendvc/vc_templates', /* Path relative to your current theme, where VC should look for new shortcode templates */

      //for which content types Visual Composer should be enabled by default
      'default_post_types' => Array('page','post','portfolio_page')
  );
  require_once locate_template('/wpbakery/js_composer/js_composer.php');
  $wpVC_setup->init($composer_settings);
}

// Initialising Shortcodes
if (class_exists('WPBakeryVisualComposerAbstract')) {
  require_once locate_template('/extendvc/extend-vc.php');
}

如果我注释这些行并尝试安装 Visual Composer 插件,我会收到以下错误:

Fatal error: Cannot redeclare wpb_getImageBySize() (previously declared in /home/likemedi/public_html/wp-content/themes/subway/wpbakery‌​/js_composer/compose‌​r/lib/helpers.php:15‌​) in /home/likemedi/public_html/wp-content/plugins/js_composer/in‌​clude/helpers/helper‌​s.php on line 114

尝试重命名 wp-content > themes > plugins > 下的插件。

只需重命名插件,然后重新加载管理页面。