# Changing Post Type in Dynamic Widgets
If you want to display posts other than the default arts_portfolio_item, arts_service, or arts_album in Elementor dynamic widgets, you can use the following filters to modify the query used to fetch the posts.
// Albums Covers List Widget
add_filter( 'arts/elementor/rhye_widget_albums_covers_list/query_args' );
// Albums Covers Slider Widget
add_filter( 'arts/elementor/rhye_widget_albums_covers_slider/query_args' );
// Albums Mouse Hover Reveal Widget
add_filter( 'arts/elementor/rhye_widget_albums_mouse_hover_reveal/query_args' );
// Portfolio Fullscreen Slider Widget
add_filter( 'arts/elementor/rhye_widget_portfolio_fullscreen_slider/query_args' );
// Portfolio Halfscreen Slider Widget
add_filter( 'arts/elementor/rhye_widget_portfolio_halfscreen_slider/query_args' );
// Portfolio Irregular Grid Widget
add_filter( 'arts/elementor/rhye_widget_portfolio_irregular_grid/query_args' );
// Portfolio Masonry Grid Widget
add_filter( 'arts/elementor/rhye_widget_portfolio_masonry_grid/query_args' );
// Portfolio Mouse Hover Reveal Widget
add_filter( 'arts/elementor/rhye_widget_portfolio_mouse_hover_reveal/query_args' );
// Portfolio Reveal Background Slider Widget
add_filter( 'arts/elementor/rhye_widget_portfolio_reveal_background_slider/query_args' );
// Services Content Block Widget
add_filter( 'arts/elementor/rhye_widget_services_content_block/query_args' );
// Services Grid Widget
add_filter( 'arts/elementor/rhye_widget_services_grid/query_args' );
// Services Slider Widget
add_filter( 'arts/elementor/rhye_widget_services_slider/query_args' );
You can use the code from the examples below in the wp-content/themes/rhye-child/functions.php file of the Rhye child theme.
# Example 1
Make the Elementor Portfolio Fullscreen Slider widget always display pages in the slider instead of portfolio items:
add_filter( 'arts/elementor/rhye_widget_portfolio_fullscreen_slider/query_args', 'custom_rhye_widget_portfolio_fullscreen_slider_query_args' );
function custom_rhye_widget_portfolio_fullscreen_slider_query_args( $args ) {
$args = array(
'post_type' => 'page', // page, post, arts_service, arts_portfolio_item, arts_album, etc...
'posts_per_page' => -1,
);
return $args;
}
# Example 2
Make the Elementor Portfolio Halfscreen Slider widget display services in the slider instead of portfolio items only on the post with ID 16:
add_filter( 'arts/elementor/rhye_widget_portfolio_halfscreen_slider/query_args', 'custom_rhye_widget_portfolio_halfscreen_slider_query_args' );
function custom_rhye_widget_portfolio_halfscreen_slider_query_args( $args ) {
global $post;
if ( $post->ID === 16 ) {
$args = array(
'post_type' => 'arts_service', // page, post, arts_service, arts_portfolio_item, arts_album, etc...
'posts_per_page' => -1,
);
}
return $args;
}
# Example 3
Make the Elementor Albums Covers List widget display portfolio items in the list instead of albums only on the homepage:
add_filter( 'arts/elementor/rhye_widget_albums_covers_list/query_args', 'custom_rhye_widget_albums_covers_list_query_args' );
function custom_rhye_widget_albums_covers_list_query_args( $args ) {
if ( is_front_page() ) {
$args = array(
'post_type' => 'arts_portfolio_item', // page, post, arts_service, arts_portfolio_item, arts_album, etc...
'posts_per_page' => -1,
);
}
return $args;
}