# Changing Post Type in Dynamic Widgets
In case you want to display posts other than defaults 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' );
The code from the examples below you can use in wp-content/themes/rhye-child/functions.php
file of Rhye child theme.
# Example 1
Make Elementor Portfolio Fullscreen Slider
widget to 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 Elementor Portfolio Halfscreen Slider
widget to display services in the slider instead of portfolio items only on post with 16
ID:
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 Elementor Albums Covers List
widget to display portfolio items in the list instead of albums only on 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;
}