How can I show drafts in wp_dropdown_pages list?

Update It seems that you can do this directly with WP function wp_dropdown_pages() as birgire points out in his response below: https://wordpress.stackexchange.com/a/240275/102371 This solution is longer, and uses get_posts() to fetch specific post statuses. $pages = get_posts( array( ‘post_type’ => ‘page’, ‘post_parent’ => 0, ‘post_status’ => array( ‘draft’, ‘publish’ ) ) ); echo ‘<select name=”selected-food-type” … Read more

Group posts by custom field

You’re close. You have: foreach (get_child_pages(wp_get_post_parent_id(get_the_ID())) as $s) { echo ‘<li><a href=”‘ . get_the_permalink($s->ID) . ‘”>’ . get_the_title($s->ID) . ‘</a></li>’; } We need to add a layer above that to show the two lists. However we can’t assume that the posts of one type will all come out together (i.e. all of one category, then … Read more

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