Reputation: 15
I have developed custom wordpress theme with integrate visual composer plugin, it is installed working properly but issue is when I have install plugin in my custom theme from backend, all visual composer functionalities working but in front end not showing design as I have set in backend which means when my theme installed visual composer plugin js and css is not loaded, when I install other theme it's working properly please get me out of this issue I was one day wast time of finding that but not get any proper solution.
For Ex: I have set three column in page from backend but when I show in front end it is not divide three column.
Header.php File
<?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">
<div id="page" class="main-site">
<header id="master-header" class="main-header">
<div class="site-branding">
<a href="<?php echo esc_url( home_url() ); ?>" class="link-logo"><img src="<?php echo esc_url( home_url() ); ?>/wp-content/uploads/2017/12/test.png" class="logo"></a>
<?php
wp_nav_menu( array(
'theme_location' => 'primary-menu',
'container_class' => 'top-navigation-menu' )
);
?>
</div>
</header>
<div id="main-content" class="data-content">
<div class="container-fluid">
Footer.php file
</div>
</div>
</div>
<?php get_footer(); ?>
</body>
</html>
Function.php File
<?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') );
}
?>
Upvotes: 0
Views: 1013
Reputation: 623
try to create the page-template like this and will show option in the backend on edit or new page section template choose the "Front page Template" and update the page will show content with visual design
<?php
/**
* Template Name: Front Page Template // You can change the name
*
* @package WordPress
* @subpackage demo // Theme Name
* @since demo 1.0
*/
get_header(); ?>
<div class="main_content">
<div class="container">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post() ?>
<?php the_content() ?>
<?php endwhile; ?>
<?php endif; ?>
</div><!-- container -->
</div><!-- main_content -->
<?php get_footer(); ?>
Upvotes: 1