• Home
  • Get help
  • Ask a question

#95 – Auto Ads for AMP

Posted in ‘weeblrAMP’
This is a public ticket. Everybody will be able to see its contents. Only enter usernames, passwords or any other sensitive information in the Private information field.
Friday, 06 July 2018 11:53 UTC
Shane_Day
 Hello,

I had a request/offer over the last weeks to enable Auto Ads for AMP for Adsense.

To do this there are two requests.

"Copy and paste this script in the head tag of your AMP HTML" and "Copy and paste this ad code in the body of your AMP HTML"

Just seeing if this is easy to do within the settings area?

Or if not, seeing if it could be added somehow into an update at some stage too :)

Here is the link to the AMP Project for you with more information > https://www.ampproject.org/docs/reference/components/amp-auto-ads

Thanks in advance for your help and thanks for a great product too!
Friday, 06 July 2018 14:04 UTC
wb_weeblrpress
Hi

Adding code cannot be done from within the settings. We use the standard WordPress methods to do that: either template overrides or using filters.

- Template overrides are described on this page of the documentation.

To add content to the head sectio, you'll need to override the weeblramp.fronted.amp.head layout. The original is located in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/head.php and your modified copy should be put in /wp-content/themes/{your_theme}/weeblramp/layouts/weeblramp/frontend/amp/head.php

For the "body" section, you should do the same with the /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/template.php layout file and copy it to /wp-content/themes/{your_theme}/weeblramp/layouts/weeblramp/frontend/amp/template.php

- Filters: you can also add content to those same templates without copying them but using filters instead. This is described in details on the same documentation page, on this paragraph.

Best regards





 
Saturday, 21 July 2018 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.