Hello @technicalx ,
It seems that you want to limit the post per page in the Post block.
Please refer to this setting.
You can also do this by modifying query args $query_args = array( ‘posts_per_page’ => 3,);
Please refer to this doc for more information.
I hope that helps.
No you misunderstand.
I want to show the child pages of the current page or the child pages of a specified page.
The post block just shows ALL pages, which is not much use.
Hello @technicalx ,
It seems that you want to display the child pages of the main/parent page. It is not directly possible but you can achieve the same by using our filter/hooks for a post block.
Please refer to this document.
Following custom code help you to show the child on the main parent page.
function filter_post_query( $query_args, $attributes) {
// Modify $query_args values.
// 3106 is the id of the parent page.
$query_args = array(
'post_type' => 'page',
'posts_per_page' => 3,
'post_parent' => 3106,
);
return $query_args;
}
add_filter( 'uagb_post_query_args_grid', 'filter_post_query', 10, 2 );
The above code displays the child pages of the parent page i.e 3106. Put this code in your theme function.php file.
I hope that helps.
Regards,
Sweta
Hello @technicalx ,
We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
Thank you!