Adding multiple post queries with parent and children to page - Best Way

So I am interested in allowing a custom menu to show "in three places: Menu area, Homepage body, and footer" based on the posttype "page" table list or parent and children entries and not using the WP nav menu system.

Reason is, I want users to control the menus displaying of my site using custom fields on each page. All 3 menus on the site will parent titles (w/ children page titles in the header menu only), but all with "different styling" done to each of the 3 sections.

I will make the function a shortcode [mycustommenu area="header"] which will allow me to pass "header" attribute into my function.

So my questions are:

Should I use WP_Query OR the get_posts / get_children function for this?

Should I run multiple loops separated by if statements if(atts['header']): or should I just do 1 loop and separate the object->results with the if statements?

Just looking for the best solution in terms of optimization. And IF there is a better way to do this all together, please let me know :)

Topic get-children get-posts wp-query Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.