Jump to content


Photo
- - - - -

Google Adsense Placement

google adsense pagelines framework

Best Answer Danny , 27 January 2013 - 11:44 AM

All hooks, are added to your child themes functions.php file.

Go to the full post


  • Please log in to reply
8 replies to this topic

#1 theflightattendantlife

theflightattendantlife

    Newbie

  • Members
  • 2 posts
  • Country: Country Flag

Posted 21 October 2012 - 03:32 AM

My website is www.theflightattendantlife.com

What I want to do is place Google Adsense Leaderboard Ads in certain places on the different pages.

The Front Page:

I want an ad below the features section

For the following pages:

About, Where I've Been, Upcoming Adventures, Inflight Dietitian, Flight Fashion

I want an ad placed right below the header.

My question is, should I use the callout section, masthead, features...??? to place the code. Just want to know the best way to do this.

Thanks

#2 Danny

Danny

    Is Awesome!

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

Posted 21 October 2012 - 08:54 AM

Hi,

To position this correctly, you would probably be best using a hook. First thing you should do is go to the PageLines store and install the free plugin called Action Map. Once installed, go to your homepage, refresh your site and in the top left hand side of your Wordpress admin bar, a new link should be visible called Action Map. Clicking this link, will load all the hook locations on your site, this will assist in locating the correct position for you to add your Google Leader-board.

Below is just an example of a hook and will not actually work, you will need to amend the code.

Please Login or Register to see this Hidden Content



You may need to use CSS to style and position the ad correctly.

#3 DIYPropertyManager

DIYPropertyManager

    Newbie

  • Members
  • 3 posts
  • Country: Country Flag

Posted 04 December 2012 - 03:36 AM

Hey Danny,

 

I have used the recommended PHP function that you provided in Comment #2 and that works great for a standard desktop browser.  My problem now is when a mobile browser is used, such as that on an iPhone, the adsense ad is not resized.  My assumption would be that I would also need to have a mobile version of the advertisement, but I am not sure how to appropriately switch between the two dependent on the user-agent.

 

 

Any help would be appreciated!

 

- DIY Property Manager

 

Please Login or Register to see this Hidden Content



#4 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 04 December 2012 - 06:41 AM

Hi there, I'd say check back with google to see if the add has a set width/height in pixels or if there's a code for a responsive version. Usually responsive sizes are done in percentages not set figures such as 300px etc.



#5 DIYPropertyManager

DIYPropertyManager

    Newbie

  • Members
  • 3 posts
  • Country: Country Flag

Posted 04 December 2012 - 05:17 PM

Google does not provide a responsive advertisement, everything must be taken care of through JS and CSS apparently.  Here is something that I found during a search...

 

 

 

Please Login or Register to see this Hidden Content



#6 Rob

Rob

    One Smart Egg

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

Posted 04 December 2012 - 10:18 PM

Your ad (as with all non-mobile Google Adsense) is designed for a static sized view.  You'll note their code includes 728 and 90, which are pixel sizes.  Those ads will likely not resize in Mobile View.

 

Go to Dashboard > PageLines > Site Options > Website Setup and check the box to Disable Mobile View.  Your site will still be fully responsive, yet it will look exactly as it does in a non-mobile computer.



#7 danielj

danielj

    Member

  • Members

  • 14 posts
  • Framework Version:2.1.7
  • Country: Country Flag

Posted 27 January 2013 - 06:01 AM

Hello. Where do I actually add the code for the hook? In my case, I want to place a google ad in pagelines_before_postloop, and want to add code like this to loop_start (or something like this. It's what I used in the previous version of the site with a completely different theme):

 

Please Login or Register to see this Hidden Content



#8 Danny

Danny

    Is Awesome!

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

Posted 27 January 2013 - 11:44 AM   Best Answer

All hooks, are added to your child themes functions.php file.



#9 danielj

danielj

    Member

  • Members

  • 14 posts
  • Framework Version:2.1.7
  • Country: Country Flag

Posted 28 January 2013 - 12:01 AM

Thanks again! I didn't do a child theme yet - I added a line at the end of functions.php that calls child_functions.php. That way when I upgrade I just have to remember to add that line back in, but my changes won't get stepped on. I'll tackle child themes at some other point, but this buys me time while I get the site looking closer to the way I want.







Also tagged with one or more of these keywords: google adsense, pagelines framework