Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Custom Parent Page Query for Advanced Query Loop

Home / Forums / Kadence Blocks / Custom Parent Page Query for Advanced Query Loop

This topic is: Resolved
[Resolved]
Posted in: Kadence Blocks
January 11, 2024 at 3:17 pm

I am trying to show ONLY 1st level child pages of a specific Parent Page, but can’t seem to get it to work. I have tried a few things so far…

add_filter( 'kadence_blocks_pro_query_loop_query_vars', function( $query, $ql_query_meta, $ql_id ) {

if ( $ql_id == 124 ) {
$query['post_parent'] = 456;
}
return $query;
}, 10, 3 );

and

add_filter( 'kadence_blocks_pro_query_loop_query_vars', function( $query, $ql_query_meta, $ql_id ) {

if ( $ql_id == 8738 ) {
$query['post_type'] = 'page';
$query['post_parent'] = array(
'value' => 5165,
'compare' => '=',
);
}
return $query;
}, 10, 3 );

But neither makes any difference in the results.

  • The forum ‘Kadence Blocks’ is closed to new topics and replies.