dynamic add_action according to child pages (for homepage control)
The use of add_action() seems backwards to me. A better approach would be to hook homepage_content() into the homepage hook and then just output each section within the one hook: function homepage_content() { $the_id = 5; $item = get_post( $the_id ); $page_tree_array = get_pages( array( ‘child_of’ => $the_id ) ); foreach( $page_tree_array as $item ) … Read more