admin管理员组文章数量:1025521
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
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
本文标签: customizationQuery to get siblings and parent page
版权声明:本文标题:customization - Query to get siblings and parent page 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745622914a2159685.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论