Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #622534

    Hi,

    pre the latest update I used to add extra content to the header on the right and in line with the logo by editing /theme-name/includes/helper-main-menu.php and at line 91 add my divs.

    This was directly after the ava_main_header do_action

     do_action('ava_main_header');
            if($headerS['header_position'] != "header_top") do_action('ava_main_header_sidebar');
    		?>

    This no longer works. I’ve tried moving my code about and wrapping it in a $output.= but can’t get it to work. My content is either sitting before the logo or under.

    In this instance I’ve added: $output .="<div id='getintouch'>hello</div>"; to line 146 but it’s sitting underneath the logo.

    I know you guys are a bit busy with the new update and issues and this is for a site under development so it’s not urgent.

    Thanks

    
    	<li><?php 
    global $avia_config;
    
    $responsive		= avia_get_option('responsive_active') != "disabled" ? "responsive" : "fixed_layout";
    $headerS 		= avia_header_setting();
    $social_args 	= array('outside'=>'ul', 'inside'=>'li', 'append' => '');
    $icons 			= !empty($headerS['header_social']) ? avia_social_media_icons($social_args, false) : "";
    
    if(isset($headerS['disabled'])) return;
    
    ?>
    
    <header id='header' class=' header_color <?php avia_is_dark_bg('header_color'); echo " ".$headerS['header_class']; ?>' <?php avia_markup_helper(array('context' => 'header','post_type'=>'forum'));?>>
    
    <?php
    
    if($responsive)
    {
    	echo '<a href="#"></a>';
    	echo '<a href="#"></a>';
    }
    
    //subheader, only display when the user chooses a social header
    if($headerS['header_topbar'] == true)
    {
    ?>
    		<div id='header_meta' class='container_wrap container_wrap_meta <?php echo avia_header_class_string(array('header_social', 'header_secondary_menu', 'header_phone_active'), 'av_'); ?>'>
    		
    			      <div class='container'>
    			      <?php
    			            /*
    			            *	display the themes social media icons, defined in the wordpress backend
    			            *   the avia_social_media_icons function is located in includes/helper-social-media-php
    			            */
    						$nav = "";
    						
    						//display icons
    			            if(strpos( $headerS['header_social'], 'extra_header_active') !== false) echo $icons;
    					
    						//display navigation
    						if(strpos( $headerS['header_secondary_menu'], 'extra_header_active') !== false )
    						{
    			            	//display the small submenu
    			                $avia_theme_location = 'avia2';
    			                $avia_menu_class = $avia_theme_location . '-menu';
    			                $args = array(
    			                    'theme_location'=>$avia_theme_location,
    			                    'menu_id' =>$avia_menu_class,
    			                    'container_class' =>$avia_menu_class,
    			                    'fallback_cb' => '',
    			                    'container'=>'',
    			                    'echo' =>false
    			                );
    			                
    			                $nav = wp_nav_menu($args);
    						}
    			                
    						if(!empty($nav) || apply_filters('avf_execute_avia_meta_header', false))
    						{
    							echo "<nav class='sub_menu' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
    							echo $nav;
    		                    do_action('avia_meta_header'); // Hook that can be used for plugins and theme extensions (currently: the wpml language selector)
    							echo '</nav>';
    						}
    						
    						
    						//phone/info text	
    						$phone			= $headerS['header_phone_active'] != "" ? $headerS['phone'] : "";
    						$phone_class 	= !empty($nav) ? "with_nav" : "";
    						if($phone) 		{ echo "<div class='phone-info {$phone_class}'><span>".do_shortcode($phone)."</span></div>"; }
    							
    							
    			        ?>
    			      </div>
    		</div>
    
    <?php } 
    	
    	
    	
    	$output 	 = "";
    	$temp_output = "";
    	$icon_beside = "";
    	
    	if($headerS['header_social'] == 'icon_active_main' && empty($headerS['bottom_menu']))
    	{
    		$icon_beside = " av_menu_icon_beside"; 
    	}
    	
    	
    	
    	
    	
    	
    ?>
    		<div  id='header_main' class='container_wrap container_wrap_logo'>
    	
            <?php
            /*
            * Hook that can be used for plugins and theme extensions (currently:  the woocommerce shopping cart)
            */
            do_action('ava_main_header');
            
            if($headerS['header_position'] != "header_top") do_action('ava_main_header_sidebar');
    		
    	
    				 $output .= "<div class='container av-logo-container'>";
    				 
    					$output .= "<div class='inner-container'>";
    						
    						/*
    						*	display the theme logo by checking if the default logo was overwritten in the backend.
    						*   the function is located at framework/php/function-set-avia-frontend-functions.php in case you need to edit the output
    						*/
    						$addition = false;
    						if( !empty($headerS['header_transparency']) && !empty($headerS['header_replacement_logo']) )
    						{
    							$addition = "<img alt='' />";
    						}
    						
    						$output .= avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true);
    						
    							if(!empty($headerS['bottom_menu']))
    							{
    								ob_start();
    								do_action('ava_before_bottom_main_menu'); // todo: replace action with filter, might break user customizations
    								$output .= ob_get_clean();
    							}
    							
    						    if($headerS['header_social'] == 'icon_active_main' && !empty($headerS['bottom_menu']))
    						    {
    							    $output .= $icons;
    						    }
    						    
    						
    						/*
    						*	display the main navigation menu
    						*   modify the output in your wordpress admin backend at appearance->menus
    						*/
    						  
    						    if($headerS['bottom_menu'])
    						    { 
    							    $output .= "</div>";  
    								$output .= "</div>";
    								  $output .="<div id='getintouch'>hello</div>";
    								if( !empty( $headerS['header_menu_above'] ))
    								{
    									$avia_config['temp_logo_container'] = "<div class='av-section-bottom-logo header_color'>".$output."</div>";
    									$output = "";
    								}
    								
    								$output .= "<div id='header_main_alternate' class='container_wrap'>";
    								$output .= "<div class='container'>";
    							}
    						
    						
    						    $output .= "<nav class='main_menu' data-selectname='".__('Select a page','avia_framework')."' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
    						        $avia_theme_location = 'avia';
    						        $avia_menu_class = $avia_theme_location . '-menu';
    						        $args = array(
    						            'theme_location'	=> $avia_theme_location,
    						            'menu_id' 			=> $avia_menu_class,
    						            'menu_class'		=> 'menu av-main-nav',
    						            'container_class'	=> $avia_menu_class.' av-main-nav-wrap'.$icon_beside,
    						            'fallback_cb' 		=> 'avia_fallback_menu',
    						            'echo' 				=>	false, 
    						            'walker' 			=> new avia_responsive_mega_menu()
    						        );
    						
    						        $main_nav = wp_nav_menu($args);
    						        $output .= $main_nav;
    						        
    						      
    						    /*
    						    * Hook that can be used for plugins and theme extensions
    						    */
    						    ob_start();
    						    do_action('ava_inside_main_menu'); // todo: replace action with filter, might break user customizations
    						    $output .= ob_get_clean();
    						    
    						    if($icon_beside)
    						    {
    							    $output .= $icons; 
    						    }
    						        
    						    $output .= '</nav>';
    						
    						    /*
    						    * Hook that can be used for plugins and theme extensions
    						    */
    						    ob_start();
    						    do_action('ava_after_main_menu'); // todo: replace action with filter, might break user customizations
    							$output .= ob_get_clean();
    				
    					 /* inner-container */
    			        $output .= "</div>";
    						
    		        /* end container */
    		        $output .= " </div> ";
    		   		
    		   		
    		   		//output the whole menu     
    		        echo $output; 
    		        
    		        
    		   ?>
    
    		<!-- end container_wrap-->
    		</div>
    		
    		<div class='header_bg'></div>
    
    <!-- end header -->
    </header></li>
    • This topic was modified 8 years, 7 months ago by Yigit. Reason: added html tags
    #622625

    Hi DigitalEssence!

    Do you mind creating a temporary admin login and posting it here with screenshot showing the changes you would like to make privately?

    Best regards,
    Yigit

    #622887

    Hi, I’ve created a user for you with the details below.

    What I’m trying to achieve is this:

    Screenshot of additional divs in header

    I used to do this by editing the helper-main-menu.php but am now struggling post update.

    #622888

    That’s odd. The image I uploaded to imgur isn’t embedding correctly.

    The direct url is: http://imgur.com/YsE1x0f

    #623017

    Hi!

    Please create a functions.php file in your child theme and add PHP opening tag <?php
    then refer to this post – http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/

    Regards,
    Yigit

    #623232

    Thanks for the guide on adding a widget. I’ve tried this but like adding the content to the helper file, the widget is sitting before the logo and when I try to move it down using padding or margin it just pushes the logo further down.

    #624935

    Hi,

    Use this code instead:

    
    #header_main .widget {
    position: absolute;
    right: 20px;
    top: 40px;
    }
    
    #header_main #getintouch {
    color:#333;
    width: 230px;
    outline:1px solid red;
    z-index:150;
    }

    Best regards,
    Josue

    #624953

    Thanks Josue,

    I had to change the top: from 40px to -120px but that has worked perfectly.

    Any idea why I can no longer add this via the /includes/helper-main-menu.php like what I did in the “olden days”?

    thanks,

    Hedley

    #624955

    Ok, the change from 40px to -120px was becasue I was using hte Chrome Web Developer extension. Once I’d placed the css in the stle.css file, the original 40px value worked.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘HOWTO: Add divs to the header – My code doesn't work after update’ is closed to new replies.