• Resolved emmykk

    (@emmykk)


    hello friends,this is a premium theme for $0,i love it

    but how do i create a widget area in the header.i want to add adsense in that area.

    thanks friends

Viewing 5 replies - 16 through 20 (of 20 total)
  • Hi,

    I’ve created a new sidebar named sidebar-flags in order to place the Qtranslate flags in the top menu, next to “Search”, in the left. I can not manage placing the code line <?php dynamic_sidebar(‘sidebar-flags’); ?> in header.php, in the right place. Please help. Thank you very much.

    <!DOCTYPE html>
    <html class="no-js" <?php language_attributes(); ?>>
    
    <head>
    	<meta charset="<?php bloginfo('charset'); ?>">
    	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    	<title><?php wp_title(''); ?></title>
    
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
    
    	<?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    
    <div id="wrapper">
    
    	<header id="header">
    
    		<?php if ( has_nav_menu('topbar') ): ?>
    			<nav class="nav-container group" id="nav-topbar">
    				<div class="nav-toggle"><i class="fa fa-bars"></i></div>
    				<div class="nav-text"><!-- put your mobile menu text here --></div>
    				<div class="nav-wrap container"><?php wp_nav_menu(array('theme_location'=>'topbar','menu_class'=>'nav container-inner group','container'=>'','menu_id' => '','fallback_cb'=> false)); ?></div>
    				<div class="container">
    					<div class="container-inner">
    						<div class="toggle-search"><i class="fa fa-search"></i></div>
    						<div class="search-expand">
    							<div class="search-expand-inner">
    								<?php get_search_form(); ?>
    							</div>
    						</div>
    					</div><!--/.container-inner-->
    				</div><!--/.container-->
    
    			</nav><!--/#nav-topbar-->
    		<?php endif; ?>
    
    		<div class="container group">
    			<div class="container-inner">
    
    				<?php if ( ot_get_option('header-image') == '' ): ?>
    				<div class="group pad">
    					<?php echo alx_site_title(); ?>
    					<?php if ( ot_get_option('site-description') != 'off' ): ?><p class="site-description">
    <?php bloginfo( 'description' ); ?></p><?php endif; ?>
    				</div>
    				<?php endif; ?>
    				<?php if ( ot_get_option('header-image') ): ?>
    					<a>" rel="home">
    						<img class="site-image" src="<?php echo ot_get_option('header-image'); ?>" alt="<?php get_bloginfo('name'); ?>">
    					</a>
    				<?php endif; ?>
    
    				<?php if ( has_nav_menu('header') ): ?>
                                            <?php alx_social_links() ; ?>
    					<nav class="nav-container group" id="nav-header">
    						<div class="nav-toggle"><i class="fa fa-bars"></i></div>
    						<div class="nav-text"><!-- put your mobile menu text here --></div>
    						<div class="nav-wrap container"><?php wp_nav_menu(array('theme_location'=>'header','menu_class'=>'nav container-inner group','container'=>'','menu_id' => '','fallback_cb'=> false)); ?></div>
    					</nav><!--/#nav-header-->
    				<?php endif; ?>
    
    			</div><!--/.container-inner-->
    		</div><!--/.container-->
    
    	</header><!--/#header-->
    
    	<div class="container" id="page">
    		<div class="container-inner">
    			<div class="main">
    				<div class="main-inner group">

    hi Starta Blogg

    I read your post and saw your site which the position of adsense looks really well in place. now, which part of header.php codes did you insert the adsense? is before, between or after this codes?

    <div class="group pad">
    <?php echo alx_site_title(); ?>
    <?php if ( !ot_get_option('site-description') ): ?><p class="site-description"><?php bloginfo( 'description' ); ?></p><?php endif; ?>
    <?php dynamic_sidebar('header-ads'); ?>
    </div>

    I did followed Alex steps of adding another ID, but im stuck here at header.php section.

    gaiusf,

    You dont put your adsense code directly into the header.php file. To get the ad to work you put the code into the sidebar that you created which should now be available under the widgets section of your dashboard. Note that the name of your sidebar and the name placed in your php code should be the same for this to work. Also this sidebar isnt just limited to ad space, you can put what ever you want in to it and it will appear in your header.

    beekstick,

    Thank you so much for that clarification. this thread has gone resolved already! but thanks once again.

    cheers!

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘how do i add widget area right of the logo in header?’ is closed to new replies.