• Resolved rasimm

    (@rasimm)


    I am currently having issues on where to put the code for the header excatly in the header.php. I have watched the video instruction on this but I dont have that section in my php.
    Here is my header.php:

    <?php
    /**
    * The Header template for our theme
    *
    * Displays all of the <head> section and everything up till <div id=”main”>
    *
    * @package WordPress
    * @subpackage Furnilife_Theme
    * @since Furnilife 1.0
    */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <?php $furnilife_opt = get_option( ‘furnilife_opt’ ); ?>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <meta name=”viewport” content=”width=device-width, initial-scale=1″>
    <link rel=”profile” href=”https://gmpg.org/xfn/11&#8243; />
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>” />
    <?php wp_head(); ?>
    </head>
    <body <?php body_class(); ?>>
    <div class=”wrapper <?php if($furnilife_opt[‘page_layout’]==’box’){echo ‘box-layout’;}?>”>
    <div class=”page-wrapper”>
    <?php if(isset($furnilife_opt[‘header_layout’]) && $furnilife_opt[‘header_layout’]!=”){
    $header_class = str_replace(‘ ‘, ‘-‘, strtolower($furnilife_opt[‘header_layout’]));
    } else {
    $header_class = ”;
    }
    if(class_exists(‘RevSliderFront’)){
    $hasSlider_class = ‘rs-active’;
    } else {
    $hasSlider_class = ”;
    }
    ?>
    <div class=”header-container <?php echo esc_html($header_class).” “.esc_html($hasSlider_class) ?>”>
    <div class=”header”>
    <div class=”header-content”>
    <?php
    if ( isset($furnilife_opt[‘header_layout’]) && $furnilife_opt[‘header_layout’]!=””) {
    $jscomposer_templates_args = array(
    ‘orderby’ => ‘title’,
    ‘order’ => ‘ASC’,
    ‘post_type’ => ‘templatera’,
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => 30,
    );
    $jscomposer_templates = get_posts( $jscomposer_templates_args );

    if(count($jscomposer_templates) > 0) {
    foreach($jscomposer_templates as $jscomposer_template){
    if($jscomposer_template->post_title == $furnilife_opt[‘header_layout’]){
    echo do_shortcode($jscomposer_template->post_content);
    }
    }
    }
    } else {
    ?>
    <div class=”header-default”>
    <div class=”container”>
    <div class=”header-top”>
    <?php if( isset($furnilife_opt[‘logo_main’][‘url’]) && $furnilife_opt[‘logo_main’][‘url’]!=”){ ?>
    <div class=”logo”><div class=”logo-inner”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”>” alt=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” /></div></div>
    <?php
    } else { ?>
    <h1 class=”logo site-title”><span class=”logo-inner”>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></span></h1>
    <?php
    } ?>
    </div>
    <div class=”header-bottom”>
    <div class=”nav-container”>
    <div class=”horizontal-menu visible-large”>
    <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘container_class’ => ‘primary-menu-container’, ‘menu_class’ => ‘nav-menu’ ) ); ?>
    </div>
    </div>
    </div>
    <?php if ( has_nav_menu( ‘mobilemenu’ ) ) : ?>
    <div class=”visible-small mobile-menu”>
    <div class=”mbmenu-toggler”><?php echo esc_html($furnilife_opt[‘mobile_menu_label’]);?><span class=”mbmenu-icon”><i class=”fa fa-bars”></i></span></div>
    <?php wp_nav_menu( array( ‘theme_location’ => ‘mobilemenu’, ‘container_class’ => ‘mobile-menu-container’, ‘menu_class’ => ‘nav-menu’ ) ); ?>
    </div>
    <?php endif; ?>
    </div>
    </div>
    <?php
    }
    ?>
    </div>
    </div>
    <div class=”clearfix”></div>
    </div>

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Please add the plugin shortcode after the header-content class name.
    regards

    I am currently having issues on where to put the code for the header excatly in the header.php. I have watched the video instruction on this but I dont have that section in my php.
    Here is my header.php:

    <?php
    global $shopkeeper_theme_options, $woocommerce, $wp_version;
    ?>

    <!DOCTYPE html>

    <!–[if IE 9]>
    <html class=”ie ie9″ <?php language_attributes(); ?>>
    <![endif]–>

    <html <?php language_attributes(); ?>>

    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no” />

    <link rel=”profile” href=”https://gmpg.org/xfn/11″&gt;
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>

    <!– Custom Header JS Code –>
    <?php if ( (isset($shopkeeper_theme_options[‘header_js’])) && ($shopkeeper_theme_options[‘header_js’] != “”) ) : ?>
    <?php echo $shopkeeper_theme_options[‘header_js’]; ?>
    <?php endif; ?>

    <?php wp_head(); ?>
    </head>

    <body <?php body_class(); ?>>

    <?php
    if ( (isset($shopkeeper_theme_options[‘smooth_transition_between_pages’])) && ($shopkeeper_theme_options[‘smooth_transition_between_pages’] == “1” ) ) {
    include(locate_template(‘header-loader.php’));
    }
    ?>

    <div id=”st-container” class=”st-container”>

    <div class=”st-content”>

    <div class=”page-notifications”></div>

    <?php

    $header_sticky_class = “”;
    $header_transparency_class = “”;
    $transparency_scheme = “”;

    if ( (isset($shopkeeper_theme_options[‘sticky_header’])) && ($shopkeeper_theme_options[‘sticky_header’] == “1” ) ) {
    $header_sticky_class = “sticky_header”;
    }

    if ( (isset($shopkeeper_theme_options[‘main_header_transparency’])) && ($shopkeeper_theme_options[‘main_header_transparency’] == “1” ) ) {
    $header_transparency_class = “transparent_header”;
    }

    if ( (isset($shopkeeper_theme_options[‘main_header_transparency_scheme’])) ) {
    $transparency_scheme = $shopkeeper_theme_options[‘main_header_transparency_scheme’];
    }

    $page_id = “”;
    if ( is_single() || is_page() ) {
    $page_id = get_the_ID();
    } else if ( is_home() ) {
    $page_id = get_option(‘page_for_posts’);
    } else if (class_exists(‘WooCommerce’) && is_shop()) {
    $page_id = get_option( ‘woocommerce_shop_page_id’ );
    }

    if ( (get_post_meta($page_id, ‘page_header_transparency’, true)) && (get_post_meta($page_id, ‘page_header_transparency’, true) != “inherit”) ) {
    $header_transparency_class = “transparent_header”;
    $transparency_scheme = get_post_meta( $page_id, ‘page_header_transparency’, true );
    }

    if ( (get_post_meta($page_id, ‘page_header_transparency’, true)) && (get_post_meta($page_id, ‘page_header_transparency’, true) == “no_transparency”) ) {
    $header_transparency_class = “”;
    $transparency_scheme = “”;
    }

    if (class_exists(‘WooCommerce’))
    {
    if ( is_product_category() && is_woocommerce() )
    {
    if ( $shopkeeper_theme_options[‘shop_category_header_transparency_scheme’] == ‘inherit’ )
    {
    // do nothing, inherit
    }
    else if ( $shopkeeper_theme_options[‘shop_category_header_transparency_scheme’] == ‘no_transparency’ )
    {
    $header_transparency_class = “”;
    $transparency_scheme = “”;
    }
    else
    {
    $header_transparency_class = “transparent_header”;
    $transparency_scheme = $shopkeeper_theme_options[‘shop_category_header_transparency_scheme’];
    }
    }
    }

    ?>

    <div id=”page_wrapper” class=”<?php echo $header_sticky_class; ?> <?php echo $header_transparency_class; ?> <?php echo $transparency_scheme; ?>”>

    <?php do_action( ‘before’ ); ?>

    <?php

    $header_max_width_style = “100%”;
    if ( (isset($shopkeeper_theme_options[‘header_width’])) && ($shopkeeper_theme_options[‘header_width’] == “custom”) ) {
    $header_max_width_style = $shopkeeper_theme_options[‘header_max_width’].”px”;
    } else {
    $header_max_width_style = “100%”;
    }

    ?>

    <div class=”top-headers-wrapper”>

    <?php if ( (isset($shopkeeper_theme_options[‘top_bar_switch’])) && ($shopkeeper_theme_options[‘top_bar_switch’] == “1” ) ) : ?>
    <?php include(locate_template(‘header-topbar.php’)); ?>
    <?php endif; ?>

    <?php if ( isset($shopkeeper_theme_options[‘main_header_layout’]) ) : ?>

    <?php if ( $shopkeeper_theme_options[‘main_header_layout’] == “1” || $shopkeeper_theme_options[‘main_header_layout’] == “11” ) : ?>
    <?php include(locate_template(‘header-default.php’)); ?>
    <?php elseif ( $shopkeeper_theme_options[‘main_header_layout’] == “2” || $shopkeeper_theme_options[‘main_header_layout’] == “22” ) : ?>
    <?php include(locate_template(‘header-centered-2menus.php’)); ?>
    <?php elseif ( $shopkeeper_theme_options[‘main_header_layout’] == “3” ) : ?>
    <?php include(locate_template(‘header-centered-menu-under.php’)); ?>
    <?php endif; ?>

    <?php else : ?>

    <?php include(locate_template(‘header-default.php’)); ?>

    <?php endif; ?>

    </div>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where exactly do i add the code to my header.php?’ is closed to new replies.