Query to get siblings and parent page

I would like to create a custom query ID (to use in Elementor) to get siblings pages of the current page + the parent page of the current page.

For now I get only siblings pages (without the parent page) with this code :

add_action( ‘elementor_pro/posts/query/my_custom_filter2’, function( $query ) {

$parent_page = wp_get_post_parent_id( get_the_ID() );

$query->set( ‘post_parent’, $parent_page );} );

I am sure it is not so difficult but I am a beginner and I can’t find the solution…

Thank you very much for any help

Quentin

Read more here:: Query to get siblings and parent page

Leave a Reply

Your email address will not be published. Required fields are marked *