Problem w/ get_results() and multiple versions for $parent_id
-
I have been working on the code for some time – and can not find an easy solution (I truly think this is a bug).
In many of the widget sidebars, a section of the code has the following lines:
if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_status != 'attachment'")) { ?> <div class="sidebar_box"> <h3>In This Section</h3>
This code for
get_results
is supposed to provide an index of the children after the parent_id has been identified. The challenge is that since the newer version of the WP has come out, versions of pages have been also tagged with the parent_id. Thus, even when a parent does not have a child, if it has any versions after it – the$wpdb->get_results
still does not return a NULL.Any suggestion on how to resolve this?
- The topic ‘Problem w/ get_results() and multiple versions for $parent_id’ is closed to new replies.