Last active
April 11, 2017 15:17
-
-
Save kraftbj/896fe7769339e2d2e2e960718a3a918c to your computer and use it in GitHub Desktop.
Only display Jetpack Ads on posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Remove this line if copy/pasting to an existing file. | |
/* | |
Plugin Name: Only Display Jetpack Ads on Posts | |
Plugin URI: https://kraft.blog | |
Description: Only output Jetpack Ads on posts and no other post type. | |
Author: Kraft | |
Author URI: https://kraft.im/ | |
Version: 2016.06.15 | |
License: GPL | |
*/ | |
add_action( 'wp', 'bk_limit_jetpack_ads_posts' ); | |
function bk_limit_jetpack_ads_posts(){ | |
if ( get_post_type() != 'post' ){ | |
add_filter( 'wordads_inpost_disable', '__return_true' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment