WordPress.org

Ready to get started?Download WordPress

Forums

default category for a custom post type ? (3 posts)

  1. thiswayup
    Member
    Posted 3 years ago #

    Hi

    I have a custom post type and I want to default the category to a specific one. Any help would be much appreciated! Thanks in advance!

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

  3. thiswayup
    Member
    Posted 3 years ago #

    Thanks for that!

    note to self. The secret is :

    wp_set_object_terms( $post->ID, $idOfAllTheCategoriesInAnArray,'category');

Topic Closed

This topic has been closed to new replies.

About this Topic