Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #776855

    Dear support

    we want to use google tag manager. As in other threads written we copied the header.php to our child theme. google tag manager code has set after <head> and <body> tag. But if I look on the code I did not see closing </body> tag there. Is`nt it necessary in header.php?

    <?php
    	if ( !defined('ABSPATH') ){ die(); }
    	
    	global $avia_config;
    
    	$style 				= $avia_config['box_class'];
    	$responsive			= avia_get_option('responsive_active') != "disabled" ? "responsive" : "fixed_layout";
    	$blank 				= isset($avia_config['template']) ? $avia_config['template'] : "";	
    	$av_lightbox		= avia_get_option('lightbox_active') != "disabled" ? 'av-default-lightbox' : 'av-custom-lightbox';
    	$preloader			= avia_get_option('preloader') == "preloader" ? 'av-preloader-active av-preloader-enabled' : 'av-preloader-disabled';
    	$sidebar_styling 	= avia_get_option('sidebar_styling');
    	$filterable_classes = avia_header_class_filter( avia_header_class_string() );
    	$av_classes_manually= "av-no-preview";
    	
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?> class="<?php echo "html_{$style} ".$responsive." ".$preloader." ".$av_lightbox." ".$filterable_classes." ".$av_classes_manually ?> ">
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <?php
    /*
     * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives
     * located in framework/php/function-set-avia-frontend.php
     */
     if (function_exists('avia_set_follow')) { echo avia_set_follow(); }
    
    ?>
    
    <!-- mobile setting -->
    <?php
    
    if( strpos($responsive, 'responsive') !== false ) echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';
    ?>
    
    <!-- Scripts/CSS and wp_head hook -->
    <?php
    /* Always have wp_head() just before the closing </head>
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to <head> such
     * as styles, scripts, and meta tags.
     */
    
    wp_head();
    
    ?>
    
    </head>
    
    <body id="top" <?php body_class($style." ".$avia_config['font_stack']." ".$blank." ".$sidebar_styling); avia_markup_helper(array('context' => 'body')); ?>>
    
    	<?php 
    		
    	if("av-preloader-active av-preloader-enabled" === $preloader)
    	{
    		echo avia_preload_screen(); 
    	}
    		
    	?>
    
    	<div id='wrap_all'>
    
    	<?php 
    	if(!$blank) //blank templates dont display header nor footer
    	{ 
    		 //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
             get_template_part( 'includes/helper', 'main-menu' );
    
    	} ?>
    		
    	<div id='main' class='all_colors' data-scroll-offset='<?php echo avia_header_setting('header_scroll_offset'); ?>'>
    
    	<?php 
    		
    		if(isset($avia_config['temp_logo_container'])) echo $avia_config['temp_logo_container'];
    		do_action('ava_after_main_container'); 
    		
    	?>

    above is the current header.php code from newest enfold release. Thanks for your support Marc

    #776858

    Hey L-mobileGroup!

    The body tag closes at the footer file not at the header.

    Thank you

    Cheers!
    Basilis

    #777165

    Dear Basilis

    ok thats what I thought also. But how to include tag manager code without error message? Tag manager has two codes –> one in the <head> section and one in the <body> section. When I implement the second on in the <body> section tag manager gives me a error –> body tag not closed.

    Question is also –> how to implement tag manager without a plugin the right way into enfold theme?

    Thanks for your support Marc

    #777506

    Hi Marc,

    Try putting the second code in footer.php before closing body tag.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    • This reply was modified 7 years, 8 months ago by Victoria.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.