Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save herbie4/5a35355bbafa6b85c7eb9b86617f48aa to your computer and use it in GitHub Desktop.
Save herbie4/5a35355bbafa6b85c7eb9b86617f48aa to your computer and use it in GitHub Desktop.
Avada post cards: exclude current post from post card when using post cards in a show other on a single post page
<?php
// Avada post cards: exclude current post from post card
// when using post cards in a show other on a single post page
// ----------------------------
// change the post card id (2700) to your own post card id!
// ----------------------------
function hhdev_post_card_blog_exclude_current_post( $query_args ) {
if(fusion_is_post_card(2700) && !is_archive()) $query_args['post__not_in'] = array(get_the_ID());
return $query_args;
}
add_filter( 'fusion_post_cards_shortcode_query_args', 'hhdev_post_card_blog_exclude_current_post', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment