Jump to content

Archived

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

mtaus

Responsive AdSense ad

Recommended Posts

mtaus

I'm trying to add a responsive Goolge AdSense ad to the header and footer sections of a site. I've taken 3 passes at it now but have been unable to get it to work:

 

  • I attempted to place the embed code in a TextBox, but WordPress adds <p> around the code, which prevents Google from serving the ad.
  • I next attempted to use a [pl_raw] short code to wrap the embed code, but Pagelines did not "recognize" the code and left the TextBox blank.
  • Finally, I added the code to a custom widget and then placed it in a Widgetizer space, which worked, except that Widgetizer assumes that each widget should be "widget-sized" so the ad will only allow up to 384px in width.

So my question: is there either (a) a simple way to add the responsove embed code (including a <style> and a <script> section) in to TextBox or (b) is there a simple way to create a widget style class that will allow Widgetizer to display a single widget that will be resized to fit responsively?

 

Thanks in advance!

Share this post


Link to post
Share on other sites
Danny

Hi,

 

Can you provide the code you're using so I can try this myself please. You can add your code to http://paste.pagelines.com/


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

Is that code correct, as when I add it to my test site, the ad is giving me an 404 error via google, basically saying it can't find the ad.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

OK, to get this to work inside a TextBox or MediaBox (I used a MediaBox) without the addition of

tags on linebreaks, you will need to basically minify the code. I have done this for you.

Simply add the code to a MediaBox Text and HTML field and then click publish.

 

https://gist.github.com/anonymous/ce60cc5b6ea4128c3e41

 

http://d.pr/i/rkmd


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
mtaus

Danny - you're brilliant! Thank you 

 

:thumbsu:

Share this post


Link to post
Share on other sites
Danny

hehe, No problem!


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
viewgoo

I have a request from a potential client for ad space and a sports ticker on their new website I am planning on building in pagelines DMS. Do you have any Idea if these thing are possible to achieve on a responsive pagelines website?

Share this post


Link to post
Share on other sites
James B

Hi there, if the sports ticker is a html embed you can paste into a widget and use css to try and make it act responsively like in the code Danny pasted above.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

  • Similar Content

    • balfred1345
      By balfred1345
      Hi,
      I've got a client on a DMS ver. 1.1.9.1 site. Using WP 4.5.2.
      The site is clean from malware. And I've replicated the below problem with all plugins off except for DMS Pro Tools
      Here's the page: http://choralartsensemble.org/support/sponsors/
      When a textbox or column with textbox on the page are deleted, upon save and refresh one or more textboxes in the header and footer loses its content. This is a repeatable occurrence. 
      Can you please tell me how to fix this so it does not happen again? 
    • John Olsson
      By John Olsson+
      I have a problem with the regular textbox in pl5, in this case, the text goes in that container, but it will hide som of the text, as if the container itself won't fit?
      Is this some kind of bug or have I done something stupid, never happend before with pl5 doh, can I do something smart about it?
      Version: Version 5.0.108
      Look here: www.gastronova.co56.se

    • abuzzelli
      By abuzzelli+
      I'm having an issue with a site I'm working on. The widgets in the footer area are showing up wrong on the home page, but look right on the rest of the pages. I tried deactivating plugins that might be causing the issue, but can't figure it out. Any ideas?
       


    • Kempston
      By Kempston+
      Good day
      How do I indent textbox content so that it's not flush against the side of the screen on mobile devices?
      When I view Kempston Truck Hire East London on my phone, the text is aligned against the side of the screen and doesn't look right.
      Many thanks
      Rob
    • Ellery
      By Ellery
      Hi
      I am using WPML v3.2.7 and pagelines 2.2.
      Can you please tell if I can use WPML to translate text in textbox?  or other components in pagelines?  Because I saw there are a number of topics regarding WPML.
      By the way, I read this blog post from pagelines:
      http://www.pagelines.com/translation-localization-center/
      but the PageLines Translation Center link is 404 (http://pagelines.com/translate/projects/pagelines-framework) 
      Thank you very much for your help.
×