Jump to content


Photo

Step by step tutorial on adding a banner ad to the header?


  • Please log in to reply
8 replies to this topic

#1 markland

markland

    Advanced Member

  • Members

  • 42 posts
  • Country: Country Flag

Posted 19 July 2012 - 11:32 PM

Is there a brainless, step by step tutorial on how to add a banner ad to a header? I see this asked often, but in each occasion everyone is told to learn about hooks... which is not an answer. (Worse, sometimes people are then steered towards instructions on how to use the PageLines banner feature, which isn't the same thing... unless I'm mistaken). Anyway, would be appreciated.

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 20 July 2012 - 01:55 AM

Using a hook would be the simplest way to add a banner ad to the header without going into the template files and editing the code the hard way. Have you seen this documentation on using hooks in PlatformPro?: http://www.pagelines...se-child-theme. Do you already have base child theme installed?

#3 markland

markland

    Advanced Member

  • Members

  • 42 posts
  • Country: Country Flag

Posted 20 July 2012 - 02:44 AM

No offense, but that's exactly the response I was NOT looking for. (unless there's a link in there that explains how to use a hook to insert a banner ad in the header).

#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 12929 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 20 July 2012 - 07:16 AM

Hi Markland, 1. Add the Universal Sidebar to your Header template 2. Then go to Appearance > Widgets and drag and drop a text widget into the Universal Sidebar. 3. In the Text Widget add your banner ads code and save. 4. Refresh your website and the banner ad should be visible.

#5 markland

markland

    Advanced Member

  • Members

  • 42 posts
  • Country: Country Flag

Posted 21 July 2012 - 12:15 AM

Thanks, Danny, but don't think this addresses my need. I already have ads in my sidebar - but I'm looking to put a standard banner ad to the right of my branding logo. This is pretty standard for sites and is even an implemented feature on many other themes... as robust as Pagelines is, surprised it hasn't been tackled here.

#6 Rob

Rob

    One Smart Egg

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

Posted 21 July 2012 - 10:42 PM

That uses a hook.

In PageLines Customize plugin, in the functions.php, add and modify this code:
 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">
	Place the ad code here.
	</div>
	<?php }
	// end function

Then in Dashboard > PageLines > Site Options > Custom Code > CSS Rules, add this:
 #branding .leaderboard {
	    float: right;
	    z-index: 10;
	    position: relative;
	}


#7 markland

markland

    Advanced Member

  • Members

  • 42 posts
  • Country: Country Flag

Posted 23 July 2012 - 07:26 AM

Thanks, Rangelone! Worked like a charm!

#8 jjohnson

jjohnson

    Newbie

  • Members
  • 6 posts
  • Country: Country Flag

Posted 16 October 2012 - 10:44 PM

By the way, the example above doesn't work (at least not for me) - server error. I finally found another example that did work, and it includes:


 add_action(&#39;pagelines_before_branding_icons&#39;



instead of inside_top_branding, and also:

 
<?php
}

At the end of functions.php

#9 Danny

Danny

    Is Awesome!

  • Moderators
  • 12929 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 17 October 2012 - 08:00 AM

Thanks for informing us.