• Resolved gregtallent

    (@gregtallent)


    This field does not show the category ID – would be useful. I’m hacking some php code at the moment trying to get all posts from a certain category from wp_posts. Can’t figure out why it doesn’t have the ID. Just shows 0’s.

    Thank you
    Greg
    http://www.bearstorm.com

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is a legacy field, left over from earlier versions of WordPress. Old versions only allowed a post to live in one category, and this field would record the category ID.

    When newer versions allowed posts to be assigned to more than one category, the old system became obsolete. Now post<->category information is maintained in the post2cat table.

    Thread Starter gregtallent

    (@gregtallent)

    Thanks, Skippy.

    Understood. So, that’s why it’s filled with nothing.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘post_category field in wp_posts’ is closed to new replies.