Created
May 24, 2024 06:32
-
-
Save tdmrhn/692827b10ddfe2e3542615f0eb7304f3 to your computer and use it in GitHub Desktop.
Blocksy Posts Shortcode exclude current post from query
This file contains 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 | |
add_filter('blocksy:general:shortcodes:blocksy-posts:args', function ($query_args, $shortcode_args) { | |
if (is_singular('portfolio')) { | |
$query_args['post__not_in'] = array(get_the_ID()); | |
} | |
return $query_args; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment