Archived

This topic is now archived and is closed to further replies.

  • 0

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

Question

Posted · Report post

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.

Share this post


Link to post
Share on other sites

8 answers to this question

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Posted · Report post

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
	?>
	
Place the ad code here.
<?php } // end function[/code] Then in Dashboard > PageLines > Site Options > Custom Code > CSS Rules, add this:
[code]#branding .leaderboard { float: right; z-index: 10; position: relative; }

Share this post


Link to post
Share on other sites

Posted · Report post

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('pagelines_before_branding_icons'
instead of inside_top_branding, and also:

<?php

}

[/code]

At the end of functions.php

Share this post


Link to post
Share on other sites

Posted · Report post

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.com/docs/base-child-theme. Do you already have base child theme installed?

Share this post


Link to post
Share on other sites

Posted · Report post

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).

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for informing us.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks, Rangelone! Worked like a charm!

Share this post


Link to post
Share on other sites

Posted · Report post

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.

Share this post


Link to post
Share on other sites