I am doing some testing with custom post types.
Assume I have various page templates and a custom post type template that share one footer.php file. In the footer, I call do_dis_function() which is simply defined as:
function do_dis_function() {
global $post;
the_ID();
// echo get_the_ID();
// echo $post->ID;
}
In both cases, in the page and/or CPT template, an ID displays... but only in the page template is it consistent.
Upon further testing, I realize that if I am viewing the custom post type template, the ID that's echoed, which seems random at first, looks to be an ID from a custom post type entry which shares the same category.
So to break it down, I have 5 projects, 2 categories. 3 of the projects share the same category. Their IDs are 16, 22 and 41. If I'm viewing post 22, the ID echoed is either 16 or 41.
Dafuq. Someone please explain.

get_related_portfolio_projects()Didn't see it, right before the footer call. I assume I have to then just reset the query? – mousesports Nov 15 '12 at 18:21