[Resolved] in the list of child_pages is always an autosave Link of the parent
I would like to show a list of child_pages on a parent page.
now WP shows me always a link to an autosave post from the parent page, the link is linking to error 404 and I don’t know how to stop this.
Parent Pages name is *Hi
I edit the page *Hi and now the list show me
*Hi with an false url
my code to display the child pages is:
if ( is_page() ) : global $post, $wpdb; $parent_ID = ($post->post_parent) ? $post->post_parent : $post->ID; $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parent_ID"); if($pages) : foreach($pages as $post) : // child pages loop setup_postdata($post); ......my stuff endforeach; endif; // end child pages loop endif;
- The topic ‘[Resolved] in the list of child_pages is always an autosave Link of the parent’ is closed to new replies.