File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ function ampforwp_adsense_ads($args){
3030 }
3131
3232 if ('on ' === $ is_responsive ){
33- $ ad_code = '<amp-ad class="aa_wrp aa_adsense aa_ ' .$ post_adsense_ad_id .'"
33+ $ ad_code = '<amp-ad data-block-on-consent class="aa_wrp aa_adsense aa_ ' .$ post_adsense_ad_id .'"
3434 width="100vw" height=320
3535 type="adsense"
3636 data-ad-client=" ' . $ ad_client .'"
@@ -42,7 +42,7 @@ function ampforwp_adsense_ads($args){
4242 }
4343 else {
4444
45- $ ad_code = '<amp-ad class="aa_wrp aa_adsense aa_ ' .$ post_adsense_ad_id .'"
45+ $ ad_code = '<amp-ad data-block-on-consent class="aa_wrp aa_adsense aa_ ' .$ post_adsense_ad_id .'"
4646 type="adsense" ' .$ optimize .'
4747 width=" ' . $ width .'"
4848 height=" ' . $ height .'"
@@ -102,7 +102,7 @@ function ampforwp_incontent_adsense_ads($id){
102102 }
103103
104104 if ('on ' === $ is_responsive ){
105- $ ad_code = '<amp-ad class="aa_wrp aa_incontent_adsense aa_ ' .$ post_adsense_ad_id .'"width="100vw" height=320
105+ $ ad_code = '<amp-ad data-block-on-consent class="aa_wrp aa_incontent_adsense aa_ ' .$ post_adsense_ad_id .'"width="100vw" height=320
106106 type="adsense"
107107 data-ad-client=" ' . $ ad_client .'"
108108 data-ad-slot=" ' . $ ad_slot .'"
@@ -113,7 +113,7 @@ function ampforwp_incontent_adsense_ads($id){
113113 }
114114 else {
115115 $ ad_code = $ parallax_container ;
116- $ ad_code .= '<amp-ad class="aa_wrp aa_incontent_adsense aa_ ' .$ post_adsense_ad_id .'"
116+ $ ad_code .= '<amp-ad data-block-on-consent class="aa_wrp aa_incontent_adsense aa_ ' .$ post_adsense_ad_id .'"
117117 type="adsense" ' .$ optimize .'
118118 width=" ' . $ width .'"
119119 height=" ' . $ height .'"
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function ampforwp_dfp_ads($args){
2525 else {
2626 $ optimize = '' ;
2727 }
28- $ ad_code = '<amp-ad class="aa_wrp aa_dfp aa_ ' .$ post_dfp_ad_id .'"
28+ $ ad_code = '<amp-ad data-block-on-consent class="aa_wrp aa_dfp aa_ ' .$ post_dfp_ad_id .'"
2929 type="doubleclick" ' .$ optimize .'
3030 width=" ' . $ width .'"
3131 height=" ' . $ height .'"
@@ -73,7 +73,7 @@ function ampforwp_incontent_dfp_ads($id){
7373 }
7474
7575 $ ad_code = $ parallax_container ;
76- $ ad_code .= '<amp-ad class="aa_wrp aa_incontent_dfp aa_ ' .$ post_dfp_ad_id .'"
76+ $ ad_code .= '<amp-ad data-block-on-consent class="aa_wrp aa_incontent_dfp aa_ ' .$ post_dfp_ad_id .'"
7777 type="doubleclick" ' .$ optimize .'
7878 width=" ' . $ width .'"
7979 height=" ' . $ height .'"
@@ -143,6 +143,8 @@ function adsforwp_non_amp_dfp_scripts(){
143143 echo $ dfp_wp_script ;
144144 }
145145 }
146+ wp_reset_query ();
147+ wp_reset_postdata ();
146148}
147149
148150function ampforwp_dfp_sticky_ads (){
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function adsforwp_media_net_ads($args){
2626 $ optimize = '' ;
2727 }
2828
29- $ ad_code = '<amp-ad class="aa_wrp aa_medianet aa_ ' .$ post_medianet_ad_id .'"
29+ $ ad_code = '<amp-ad data-block-on-consent class="aa_wrp aa_medianet aa_ ' .$ post_medianet_ad_id .'"
3030 width=" ' . $ width .'"
3131 height=" ' . $ height .'"
3232 type="medianet" ' .$ optimize .'
@@ -83,7 +83,7 @@ function adsforwp_incontent_media_net_ads($id){
8383 }
8484
8585 $ ad_code = $ parallax_container ;
86- $ ad_code .= '<amp-ad class="aa_wrp aa_incontent_medianet aa_ ' .$ post_medianet_ad_id .'"
86+ $ ad_code .= '<amp-ad data-block-on-consent class="aa_wrp aa_incontent_medianet aa_ ' .$ post_medianet_ad_id .'"
8787 width=" ' . $ width .'"
8888 height=" ' . $ height .'"
8989 type="medianet" ' .$ optimize .'
You can’t perform that action at this time.
0 commit comments