Jump to content
Sign in to follow this  
Rob

Google Leaderboard in Header

Recommended Posts

Rob

Greetings everyone, Thank you, in advance for your responses to this issue. I am trying to replicate the Google ad placement of my current non-WP index page in another section of my site. Please feel free to check the header at www.epicurus.com. I'd like to place the ad in my WP installations at www.epicurus.com/blog/ and other places within the site. Before posting, I did check the other postings about Google leaderboard ads, particularly www.pagelines.com/forum/topic/8931 and www.pagelines.com/forum/topic/8252. I was successful in following the changes proposed in 8931 in that I did not have any errors, but I also did not have the ad show up either. The width of the header space is 1020, and the branding icon is only 270px wide, so there should be plenty of room for the 728px wide ad. We don't use the social media icons in the header. Presently, you will see 3 Google ads on the Blog page, which is the maximum Google permits. When I made the attempt, I removed one of the ads from a widget to ensure the Blog had only 2 ads, plus the header. Nothing I did worked. This is what I did in function.php:

// add_action('hook_name','function name'); // ---> uncomment to load add_action('pagelines_inside_bottom_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-8686155461235202"; /* 728x90, created 5/19/11 */ google_ad_slot = "1166423252"; google_ad_width = 728; google_ad_height = 90; //--> </script></div> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <?php } // end function
and in Custom Code > Css Rules, I added
div.leaderboard {float: right;}

. Any ideas how I can get an ad in there? Something tells me the problem may be using a background that tiles in the header. I'm just not sure. By the way, I think Platform Pro is by far, the best theme ever designed for Wordpress. It really is fantastic for customization. Best, Bob


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
timlinson

Hook looks fine to me at first glance, and I do see the header ad in firefox/chrome. Are you using firefox with addons like adblockplus and/or noscript? I had to whitelist your site in both addons to see the ad.

Share this post


Link to post
Share on other sites
Rob

Tim, Thank you for your reply. If you're looking at www.epicurus.com, you're actually seeing my older, non-WordPress site, and the demo of what I want to achieve. Unfortunately, where I want to place the ad, www.epicurus.com/blog, I cannot get that hook to work.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob

As an experiment, I tried replacing the Google code with Amazon ad code, and also simple text. Nothing showed up, so it seems it's not the Google code itself. Anyone with an idea why this isn't working?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
catrina

Have you already tried deactivating your plugins and seeing if the code works after that?


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
timlinson

Also make sure that "Platform Base" is your active theme in Appearance > Themes.

Share this post


Link to post
Share on other sites
Rob

Tim, that worked, sorta. The ad is below the branding logo. Catrina, no change with disabling all plugins. Can't be a plugin conflict. Also, I tried it on other directories where I have Platform Pro installed. If it works in Platform Base, but out of place, why not in Platform Pro?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
timlinson

WP won't even load the base functions unless you tell it to do so by activating the base child theme. Regarding the location, if you go to the Template Setup page and click "Advanced Setup" on the PageLines Branding box, you'll see a list of other hook locations you can use. Try swapping `pagelines_inside_bottom_branding` with `pagelines_after_branding`.

Share this post


Link to post
Share on other sites
Rob

I tried all four of the options. The ad goes over, under, below and to the left, but not to the right of the branding logo. The only one to get it in the space it should generally be is "pagelines_inside_top_branding", but that knocks the brand logo below it and makes the ad appear to the left, not right.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
timlinson

Try `pagelines_branding_icons_end` You may need to end up using some position tweaks on the `div.leaderboard` selector in custom code > custom css.

Share this post


Link to post
Share on other sites
Rob

Just tried that one. It placed the ad literally under the menu. Not below it, but as a layer underneath it, so the menu was laying on top of the ad. Candidly, I don't know how to tweak the position in the div.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
catrina

To tweak the position in the DIV, you'll need to use CSS that's something like this:

{position: absolute; top: #px; left: #px; right: #px;}

For more on CSS positioning, please see here: http://www.w3schools.com/css/css_positioning.asp


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
Rob

Catrina, I did the following:

div.leaderboard {position: absolute; top: 15px; left: 275px;}
but it did not work. Also, I tried
div.leaderboard {position: absolute; top: 15px; left: 275px; right: 0px;}
Nothing changed. The ad went above the branding, below it, to the left and below, but never just to the right of it. I tried each of the 4 hooks again, with each of the two variable CSS described above. Not going to change anything today, so you and others can see the dilemma. www.epicurus.com/blog. Thanks for the advice. I just wish we could get this fixed soon.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob

For some reason, now, each time I try something, Platformbase is resizing the Layout Width from 1020 to 1024px. I'm giving up as it seems no solution is available that reasonably achieves the desired result.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob

I just replaced the Google ad with an Amazon ad of the exact same size. This was done using

pagelines_inside_top_branding
and the
div.leaderboard {float: right;}

and it worked. In fact, it looked great. But as soon as I used the Google ad code again, the ad shifted left, within the proper header alignment, but pushed the branding icon below it. Something about the javascript perhaps, is causing the problem. Has anyone any ideas? PLEASE!


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob

Ah... I got it. Almost perfect. I had to shift the </div> tag to the very end of the javascript, rather than before it.

	// 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-8686155461235202";
	/* 728x90, created 5/19/11 */
	google_ad_slot = "1166423252";
	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

However, it shifted my menu down about 1/8".


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kastelic

Try this in Custom Code -> Custom CSS:

#branding .content-pad {padding-bottom:24px;}

Not sure why this happened, it was just a 1 pixel difference.

Share this post


Link to post
Share on other sites
Rob

Thanks Jimmy, Tim and Catrina. I'm closing this as the problem has finally worked out beautifully. Patience with code is always a necessity, and perseverance a blessing.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kevin369
I have inserted the leaderboard (the same type as 'rangealone's) on my site. My branding logo is 40px high. The leaderboard is to the right and is 60px high... but I cannot click on the top 40px of the leaderboard ad (only the bottom 20px I can click on) If I go to 'rangealone's' site http://www.epicurus.com/blog/ I cannot click on his leaderboard ad at all. I think his branding logo is 84px high. There is a Facebook icon in the bottom right corner of the ad which I can click on but I cant click on the ad. I am using Google Chrome.

Share this post


Link to post
Share on other sites
kevin369
Rangelone... you need to change the z-index where you have placed your Google leaderboard at http://www.epicurus.com/blog/ because you cannot click on it :-c

Share this post


Link to post
Share on other sites
Rob
Thanks. I'm looking into what caused that very recent change. Those were totally clickable only a few days ago. I'm suspecting there's a problem with the ad delivery and investigating it.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kevin369
It's not the ad delivery... it's a problem with PlatformPro. I had the [url="http://www.pagelines.com/forum/discussion/16610/platformpro-is-masking-links-making-them-unclickable#Item_8"]same problem here[/url].

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  

×