Advertisement
artemsemkin

Rubenz Query Filter by Category [target to specific page]

Jan 24th, 2021
1,082
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. add_filter( 'arts/elementor/rubenz_widget_portfolio_fullscreen_headings_slider/query_args', 'custom_rubenz_widget_portfolio_fullscreen_headings_slider_query_args' );
  2. function custom_rubenz_widget_portfolio_fullscreen_headings_slider_query_args( $args ) {
  3.  
  4.   global $post;
  5.  
  6.   if ( $post->ID === 9 ) {
  7.  
  8.     $args = array(
  9.       'tax_query' => array(
  10.         array(
  11.           'taxonomy' => 'arts_portfolio_category',
  12.           'field'    => 'slug',
  13.           'terms'    => array( 'design' ), // include only posts of the current categories (slugs)
  14.         ),
  15.       ),
  16.     );
  17.  
  18.   }
  19.  
  20.   return $args;
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement