List CPT by menu_order with children right after parent

The problem with grasping implementation for such deeply nested tree is that it is best solved recursively – your code should output post, then output children and endlessly repeat the process for each child until it runs out.

However before you spend time on custom implementation you could try to look into existing functions WP provides. For example wp_list_pages() can really be used for arbitrary post type and should handle hierarchical output for you.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)