customization - 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 pa

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745622915a4636630.html

相关推荐

  • customization - 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 pa

    22天前
    70

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信