How to get the post id (of the parent custom custom type) in a loop inside a widget?
Don’t use query_posts. As noted in the Codex: Not for Secondary Loops You should not use query_posts() to create secondary listings (for example, a list of related posts at the bottom of the page, or a list of links in a sidebar widget). You should use WP_Query instead. E.g. $args = array( ‘post_type’ => ‘topic’, … Read more