Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'jnews_ads_global_enable', 'disable_ads_in_categories', 10, 3 );
- function disable_ads_in_categories( $flag, $post_id, $location ) {
- if ( get_post_type() === 'post' && is_single() && $flag && 'content_inline' === $location ) {
- $cat_id_list = array( 2, 4 ); /* cat id list that wont displayed the ads. */
- $catgegories = jnews_get_primary_category( $post_id );
- if ( in_array( $catgegories, $cat_id_list ) ) {
- return false;
- }
- }
- return $flag;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement