Last active
June 9, 2020 06:43
-
-
Save wpbean/cc607dad0dd0df575267c4188248d554 to your computer and use it in GitHub Desktop.
WPB Filterable Portfolio custom taxonomy filter
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 | |
// Add the code below to your theme functions.php file | |
add_filter( 'wpb_portfolio_post_args', function( $args, $shortcode_id ){ | |
/** | |
* $shortcode_id: shortcode generator custom shortcode ID | |
* For the Elementor use, add the Elementor widget ID | |
*/ | |
if( $shortcode_id == '771' ){ | |
$args['tax_query'][] = array( | |
'taxonomy' => 'category', // taxonomy key | |
'field' => 'id', | |
'terms' => array(89, 88), // term IDs | |
'operator' => 'IN' | |
); | |
} | |
return $args; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment