Excluding AdSense from specific post in Genesis child theme
-
Hi,
I am using a Genesis child theme.
I am using a widget in a Genesis child theme to display Adsense under post tile but I need to exclude it from two posts.
Here’s the code (this creates the widget where I just paste the AdSense code.
//* New Widget area to show ads under post title genesis_register_sidebar( array( 'id' => 'ad-after-title', 'name' => __( 'Ad After Title', 'custom' ), 'description' => __( 'This is Ad section under post title', 'custom' ), ) ); //* Show ads below post title on posts add_action( 'genesis_entry_header', 'mp_post_ad_feature', 12 ); function mp_post_ad_feature() { if ( is_single() && is_active_sidebar( 'ad-after-title' ) ) { echo '<div class="ad-after-title">'; dynamic_sidebar( 'ad-after-title' ); echo '</div><!-- end .ad-after-title -->'; } }
I have used this snippet
if(is_single( array('post1-url', 'post2-url'))): else:
in another code where the
&& is_active_sidebar
isn’t used. so I am not sure how and where to place the little snippet, or if there is any other way.I would appreciate any help. Thank you very much in advance.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Excluding AdSense from specific post in Genesis child theme’ is closed to new replies.