Jump to content
Sign in to follow this  
markland

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

Recommended Posts

markland    2
markland

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
catrina    103
catrina

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?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
markland    2
markland

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
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
markland    2
markland

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
Rob    547
Rob

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; }


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
markland    2
markland

Thanks, Rangelone! Worked like a charm!

Share this post


Link to post
Share on other sites
jjohnson    0
jjohnson

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
Danny    1,327
Danny

Thanks for informing us.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×