Skip to content

Instantly share code, notes, and snippets.

@foozlereducer
Created August 3, 2016 19:28
Show Gist options
  • Select an option

  • Save foozlereducer/f4022aa0600eae8461a257daaa80a8ed to your computer and use it in GitHub Desktop.

Select an option

Save foozlereducer/f4022aa0600eae8461a257daaa80a8ed to your computer and use it in GitHub Desktop.
<?php
/**
* Template Name: Ad Test 1
*
* @package PostMedia
*/
get_header();
// check to see if function exists before calling it
if ( function_exists( 'pn_dfp_ads' ) ) {
pn_dfp_ads()->call_ad( 'out-of-page', array( 'test' => 'adblock' ), true, false, 'gpt-outofpage' );
}
if ( function_exists( 'pn_dfp_ads' ) ) {
pn_dfp_ads()->call_ad( 'wallpaper', array( 'test' => 'adblock' ), false, false, 'gpt-wallpaper' );
}
?>
<div class="l-content marketing-page">
<div class="l-constrained container contentbody">
<section class="l-top-content">
<div class="adunit">
<?php
if ( !pn_is_mobile() )
pn_dfp_ads()->call_ad( 'leaderboard-top', array( 'test' => 'adblock' ), false, false, 'gpt-leaderboard' );
?>
</div>
<?php
if ( !pn_is_mobile() && !pn_is_tablet() )
get_template_part( 'partials/featured-slider' );
?>
</section>
<!-- / l-top-content -->
<div class="l-main no-sidebar" id="main" role="main">
<section class="adv-section adv-downloadable">
<h3>Big box top:</h3>
<?php
// check to see if function exists before calling it
if ( function_exists( 'pn_dfp_ads' ) ) {
pn_dfp_ads()->call_ad( 'big-box', array( 'test' => 'adblock' ), false, false, 'gpt-bigboxtop' );
}
?>
<h3>Big box mid:</h3>
<?php
if ( function_exists( 'pn_dfp_ads' ) ) {
pn_dfp_ads()->call_ad( 'big-box-middle', array( 'test' => 'adblock' ), false, false, 'gpt-bigboxmid' );
}
?>
<h3>Big box bot:</h3>
<?php
if ( function_exists( 'pn_dfp_ads' ) ) {
pn_dfp_ads()->call_ad( 'gpt-bigboxbot', array( 'test' => 'adblock'), false, false, 'gpt-bigboxbot' );
}
?>
</section>
</div>
<!-- / l-main -->
</div>
<!-- / container -->
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment