Post id include not working.
-
Have I got this wrong…
I can include a page by passing the ID, but not a post…
So changing this gets it to work – a hack; I’m sure there’s a more elegant way of doing it// query_posts(array('page_id' => $id)); $post_type = $wpdb->get_var("SELECT post_type FROM {$wpdb->posts} WHERE ID = '{$id}'"); if ($post_type == 'page') query_posts(array('page_id' => $id)); else if ($post_type = 'post') query_posts(array('p' => $id)); else return $r; the_post();
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Post id include not working.’ is closed to new replies.