Support » How-To and Troubleshooting » Show post_category

Show post_category

Viewing 1 replies (of 1 total)
  • Its probably too late to help you, but for anyone else trying to do this the following select works. An array of objects is returned from which you need the ‘category_id’ property.

    $wpdb->get_results("SELECT * FROM $wpdb->post2cat WHERE post_ID = $post->ID ORDER BY category_ID");

Viewing 1 replies (of 1 total)
  • The topic ‘Show post_category’ is closed to new replies.
Skip to toolbar