Home › Forums › Pro Support › Can I exclude with a custom meta field from a list? › Reply To: Can I exclude with a custom meta field from a list?
February 11, 2020 at 5:12 pm
#13344
Keymaster
Hmm, it may be possible otherwise.
Make this change in your wp-show-posts.php file: https://github.com/tomusborne/wp-show-posts/commit/286caf1164db8b6b6f38b85d3a011b519a27f4de
Then do this:
add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
if ( 123 === $settings['list_id'] ) {
$args['meta_query'] => array(
array(
'key' => 'your_custom_field',
'value' => 'your value to check',
'compare' => '!==',
)
);
}
return $args;
} );
You just need to change 123
to your list ID, and adjust the key and value.