Hey @barrenas ,
You can do this using the filter hook.
You can add the below-given code to your functions.php file.
add_filter( 'uagb_post_query_args_grid', function( $args ){
$args['post__not_in'] = array( 123, 456 );
// Add IDs of the posts with comma separation, you want to skip in place of 123, 456.
return $args;
} );
I hope this helps.
Also, here is a link to document regarding some more such filters and actions – https://www.ultimategutenberg.com/docs/filters-actions-for-post/
Regards,
Vrunda Kansara
Hi
At first thanks for ur quick answer
But i have a problem, i use the grid to show related posts with a nice style in many posts.
For this reason i need a funtion that exclude current post for each grid, not in general for specifics ids.
Thanks again
Hey,
You have to modify the code a little to achieve what you want. Try the below code
add_filter( 'uagb_post_query_args_grid', function( $args ){
$args['post__not_in'] = get_the_ID();
return $args;
} );
I hope that helps.
Regards,
Vrunda Kansara
Hi again
I have tryed this lines with my code snippet, but it doesnt works correctly.
it makes that post grid desappear.
Thanks again
Hey @barrenas ,
You can reach us out here for quicker response – https://ultimategutenberg.com/support
Regards,
Vrunda Kansara
Hi again:
I have wrote to suport for two times with no answer
Anyway, i have solved, if any have the same problem the code is:
add_filter( 'uagb_post_query_args_grid', function( $args ){
$args['post__not_in'] = array( get_the_ID() );
return $args;
} );
Like suggestion could be a great idea for future release include a tab in back end to do it.
See u
Hey @barrenas ,
I am glad you found the solution. That does not happen ideally with us. We make sure we answer every request. Sometimes the wrong email ID or some other such problem might create such glitches.
Nevertheless, you can always get back to us if you have any other issues.
Regards,
Vrunda Kansara