• Resolved technicalx

    (@technicalx)


    Pages block needs limits like showing child pages of the Current Page only or of a Specific Page ID and then we can finally use the Parent/Child pages in WordPress without doing dumb stuff like registering new post types or putting pages in the Posts categories making a mess.

    • This topic was modified 3 years, 9 months ago by technicalx.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Team Brainstorm Force

    (@brainstormteam)

    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.

    Thread Starter technicalx

    (@technicalx)

    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.

    Plugin Support Team Brainstorm Force

    (@brainstormteam)

    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

    Plugin Support Team Brainstorm Force

    (@brainstormteam)

    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pages block needs limits’ is closed to new replies.