I have a banner I am displaying on all blog posts. I would like to modify it to omit specific blog posts.
Not sure how to do this, i didn’t see any display options. Any help this would be greatly appreciated.
Hello Brain,
Thanks for posting in!
Are you referring with this code:
// Additional Functions
// ============================================================================
function custom_content_below_masthead() { ?>
<?php if ( is_single() ) : ?>
<div class="custom-shortcode">
<?php echo do_shortcode('[rev_slider alias="Fitness Banner 2"]'); ?>
</div>
<?php endif; ?>
<?php }
add_action('x_after_view_global__slider-below', 'custom_content_below_masthead');
// =============================================================================
If you wan to exclude a certain post, you will have to add other condition to the code and use is_single() && !is_single(123)
where 123 is the ID os the post. The final code might be like this:
// Additional Functions
// ============================================================================
function custom_content_below_masthead() { ?>
<?php if ( is_single() && !is_single(123) ) : ?>
<div class="custom-shortcode">
<?php echo do_shortcode('[rev_slider alias="Fitness Banner 2"]'); ?>
</div>
<?php endif; ?>
<?php }
add_action('x_after_view_global__slider-below', 'custom_content_below_masthead');
// =============================================================================
To find out the post ID, please check this out:
Hope this helps.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.