Skip to content

Commit

Permalink
fix: remove early ad display calls
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiulodro committed Jul 21, 2020
1 parent d9c9c06 commit 95a2217
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions includes/class-newspack-ads-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,12 @@ public static function code_for_ad_unit( $ad_unit ) {
$largest = self::largest_ad_size( $sizes );

$code = sprintf(
"<!-- /%s/%s --><div id='div-gpt-ad-%s-0' style='width: %spx; height: %spx;'><script>googletag.cmd.push(function() { googletag.display('div-gpt-ad-%s-0'); });</script></div>",
"<!-- /%s/%s --><div id='div-gpt-ad-%s-0' style='width: %spx; height: %spx;'></div>",
$network_code,
$code,
$unique_id,
$largest[0],
$largest[1],
$unique_id
$largest[1]
);
return $code;
}
Expand Down Expand Up @@ -485,13 +484,12 @@ function ( $item ) {
);
} else {
$markup[] = sprintf(
'<!-- /%s/%s --><div id="%s" style="width:%dpx;height:%dpx;"><script>googletag.cmd.push(function() { googletag.display("%s"); });</script></div>',
'<!-- /%s/%s --><div id="%s" style="width:%dpx;height:%dpx;"></div>',
$network_code,
$code,
$div_id,
$width,
$height,
$div_id
$height
);
}
}
Expand Down

0 comments on commit 95a2217

Please sign in to comment.