$posts = get_posts();
foreach ($posts as $post)
$post_categories = wp_get_post_categories($post->ID);
foreach ($post_categories as $cat)
Now, what is $cat? Codex says wp_get_post_categories() retrieves "the list of categories for a post." So first I thought it was an object, but it's an integer. Could it be the Category ID? No. It's always 1, even if there are posts in different categories. What is it, and how do you use it?