# Changing Post Type in Dynamic Widgets

In case you want to display posts other than defaults arts_portfolio_item or arts_service in Elementor dynamic widgets, you can use the following filters to modify the query used to fetch the posts.

// Portfolio Fullscreen Horizontal Scrolling Widget
add_filter( 'arts/elementor/kinsey_widget_portfolio_fullscreen_horizontal_scrolling/query_args' );

// Portfolio Fullscreen Slider Backgrounds 1 Widget
add_filter( 'arts/elementor/kinsey_widget_portfolio_fullscreen_slider_backgrounds_1/query_args' );

// Portfolio Fullscreen Slider Backgrounds 2 Widget
add_filter( 'arts/elementor/kinsey_widget_portfolio_fullscreen_slider_backgrounds_2/query_args' );

// Portfolio Fullscreen Slider Images 1 Widget
add_filter( 'arts/elementor/kinsey_widget_portfolio_fullscreen_slider_images_1/query_args' );

// Portfolio Halfscreen Slider Backgrounds Widget
add_filter( 'arts/elementor/kinsey_widget_portfolio_halfscreen_slider_backgrounds/query_args' );

// Portfolio List Backgrounds Widget
add_filter( 'arts/elementor/kinsey_widget_portfolio_list_backgrounds/query_args' );

// Portfolio Masonry Grid
add_filter( 'arts/elementor/kinsey_widget_portfolio_masonry_grid/query_args' );

// Portfolio Slider Cards Backgrounds
add_filter( 'arts/elementor/kinsey_widget_portfolio_slider_cards_backgrounds/query_args' );

// Posts List Backgrounds
add_filter( 'arts/elementor/kinsey_widget_posts_list_backgrounds/query_args' );

// Posts Masonry Grid
add_filter( 'arts/elementor/kinsey_widget_posts_masonry_grid/query_args' );

// Services Grid
add_filter( 'arts/elementor/kinsey_widget_services_grid/query_args' );

The code from the examples below you can use in wp-content/themes/kinsey-child/functions.php file of Kinsey child theme.

# Example 1

Make Elementor Portfolio Fullscreen Slider Backgrounds 1 widget to always display pages in the slider instead of portfolio items:

add_filter( 'arts/elementor/kinsey_widget_portfolio_fullscreen_slider_backgrounds_1/query_args', 'custom_kinsey_filter_1' );
function custom_kinsey_filter_1( $args ) {
  $args = array(
    'post_type' => 'page', // page, post, arts_service, arts_portfolio_item, etc...
  );

  return $args;
}

# Example 2

Make Elementor Portfolio Halfscreen Slider Backgrounds widget to display services in the slider instead of portfolio items only on post with 16 ID:

add_filter( 'arts/elementor/kinsey_widget_portfolio_halfscreen_slider_backgrounds/query_args', 'custom_kinsey_filter_2' );
function custom_kinsey_filter_2( $args ) {
  global $post;

  if ( $post->ID === 16 ) {
    $args = array(
      'post_type' => 'arts_service', // page, post, arts_service, arts_portfolio_item, etc...
    );
  }

  return $args;
}