Jump to content


Photo

Place Banner Ad Next to Logo in Header


  • Please log in to reply
5 replies to this topic

#1 bryanhaines

bryanhaines

    Member

  • Members
  • 15 posts
  • Framework Version:2.3

Posted 03 November 2011 - 07:24 PM

I'm trying to place a banner ad (jpg format - no javascript - around 468 x 60) on the upper right banner/header area - to the right of the blog logo. I've tried a number of ad management plugins and I've tried hooks - but I can't figure it out. It should be so simple, but I'm a little lost. Can you give me some direction?

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 03 November 2011 - 08:33 PM

When you place an ad right of the branding, you have to adjust to the correct hook and complement that with CSS to make sure the alignment is correct.

For example, from my site:
 // HOOKS EXAMPLE --------//
		// Below is an example of how you would add a social media icon to the icons in header (branding section)
		// We have placed a hook at the end of the icon set specifically add new icons without modifying code or having to worry about your edits
		// getting thrown out during the upgrade process. The way to use hooks goes a little like this:
	
		// add_action('hook_name','function name');
	
	// ---> uncomment to load
	add_action('pagelines_inside_top_branding', 'google_leaderboard_ad');
	
	// function name
	function google_leaderboard_ad(){
	// This hook adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css
	// and is the image from the CSS is placed in the images folder
	?>
	<div class="leaderboard"><script type="text/javascript"><!--
	google_ad_client = "pub-8686155461234567";
	/* 728x90, created 5/19/11 */
	google_ad_slot = "1166423456";
	google_ad_width = 728;
	google_ad_height = 90;
	//-->
	</script>
	<script type="text/javascript"
	src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script></div>
	<?php }
	// end function

Coordinates with this CSS:
 div.leaderboard {float: right;}

Without the CSS, the ad drops to the bottom of the branding area and flushes left.

While your ad placement may or may not be a Google code, the basic premise is the same. Where I have

#3 bryanhaines

bryanhaines

    Member

  • Members
  • 15 posts
  • Framework Version:2.3

Posted 03 November 2011 - 10:12 PM

Thanks Rangelone - I'll give it a try!

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 04 November 2011 - 07:46 PM

Let us know how it goes!

#5 indakno

indakno

    Super Member

  • Members
  • 110 posts
  • Country: Country Flag

Posted 17 August 2012 - 01:07 AM

Can I add a question to this same subject? How do you make it where the ad links to the add and not back to the website. Check it out: www.indakno.com

#6 batman

batman

    Bat Learning

  • Members

  • 1733 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 17 August 2012 - 02:36 AM

Hi indakno
You can try with
 #branding .branding_wrap {
	    position: absolute;}