Handlings Ads for Amp/Desktop Desktop
-
I’ve been using the AMP plugin in reader mode for a while, and I’d like to switch to transitional or standard.
I’m using a Twenty Seventeen child theme, and transitional mode works, but all ads are gone. I’m using a plugin (AdRotate Pro) for ads. I used to edit the Reader theme to insert the shortcodes, but it’s obviously not possible in other modes.
Based on https://gist.github.com/westonruter/f49e5ec4b435801c6ce875eef394a2e4, I understand I can just modify my child theme with code detection AMP endpoints in relevant part of the files as follows:
<?php if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) { /* AMP specific code here */ adrotate_group(1); } else if { /* non-amp (desktop) code here */ adrotate_group(2); endif; ?>
If that the right way to go about it? I’m a bit confused about the “function twentynineteen_ganka_styles()” in the example. It does not seem to be related to amp.
The page I need help with: [log in to see the link]
- The topic ‘Handlings Ads for Amp/Desktop Desktop’ is closed to new replies.