Last active
July 7, 2025 19:53
-
-
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
This file contains hidden or 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 | |
// 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