Show just one level of child pages, wp_list_pages woe

This should work, using nothing more than the available argument-array parameters for wp_list_pages(): specifically, depth and child_of. To display one level of hierarchy, for descendant pages of the current page: <?php // Globalize the $post variable; // probably already available in this context, but just in case… global $post; wp_list_pages( array( // Only pages that … Read more

How can I hide children of draft pages using wp_list_pages()?

Great answers above. I took on the challenge trying to find yet another way to solve this. The exclude parameter: We could try: ‘exclude’ => wpse_exclude_drafts_branches() where: function wpse_exclude_drafts_branches() { global $wpdb; $exclude = array(); $results = $wpdb->get_col( “SELECT ID FROM {$wpdb->posts} where post_status=”draft” AND post_type=”page” ” ); $exclude = array_merge( $exclude, $results) ; while … Read more

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