关于jquery:如何集成visual composer自定义wordpress主题

How to integrate visual composer custom wordpress theme

控制台图像

我开发了带有集成视觉作曲家插件的自定义 wordpress 主题,它安装正常,但问题是当我从后端在自定义主题中安装插件时,所有视觉作曲家功能都在工作,但在前端没有像我一样显示设计设置在后端,这意味着当我的主题安装了可视化作曲家插件 js 和 css 未加载时,当我安装其他主题时,它可以正常工作,请让我摆脱这个问题正确的解决方案。

例如:我从后端在页面中设置了三列,但是当我在前端显示时,它没有将三列分开。

Header.php 文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
 /*
  Template Name:Header
 */

?>
<!DOCTYPE html>

<html class="top">
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width">
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <?php wp_head();?>
</head>
<body <?php body_class(); ?> id="page-wrap">
   
        <header id="master-header" class="main-header">
           
               " class="link-logo"><img src="<?php echo esc_url( home_url() ); ?>/wp-content/uploads/2017/12/test.png" class="logo">
            <?php
                 wp_nav_menu( array(
                   'theme_location' => 'primary-menu',
                   'container_class' => 'top-navigation-menu' )
                );
            ?>
       
        </header>

Footer.php 文件

1
2
3
<?php get_footer(); ?>
  </body>
</html>

Function.php 文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
function my_theme_script(){
    wp_enqueue_style('style-css', get_template_directory_uri().'/style.css');
    wp_enqueue_style('bootstrap-css', get_template_directory_uri().'/bootstrap/css/bootstrap.min.css');
    //wp_enqueue_script('jquery-js', get_template_directory_uri().'/js/jquery.min.js');
    wp_enqueue_script('bootstrap-js', get_template_directory_uri().'/bootstrap/js/bootstrap.min.js');
}
add_action('wp_enqueue_scripts','my_theme_script');

/*Add Menu in Wordpress Admin Dashboard*/
add_theme_support( 'menus' );

add_action( 'init', 'register_my_menu' );
function register_my_menu() {
  register_nav_menu( 'primary-menu', __( 'Primary Menu') );
}
?>


尝试像这样创建页面模板,并将在编辑或新页面部分模板的后端显示选项,选择"首页模板"并更新页面将显示具有视觉设计的内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
 * Template Name: Front Page Template // You can change the name
 *
 * @package WordPress

 * @subpackage demo // Theme Name

 * @since demo 1.0
 */


get_header(); ?>

   
       
             <?php if ( have_posts() ) : ?>
                <?php while ( have_posts() ) : the_post() ?>
                    <?php the_content() ?>
                <?php endwhile; ?>
            <?php endif; ?>

        <!-- container -->
    <!-- main_content -->

<?php get_footer(); ?>

enter