Support » Fixing WordPress » Function to insert post into a category.

  • Resolved fatalx



    I was wondering if there is a function that will add a post (via post id) into specific categories (custom taxonomies in my case). I have been looking around for the function that does it but could not find it.


Viewing 2 replies - 1 through 2 (of 2 total)
  • I figured out my problem. I found this function


    it’s used this way


    $cat_ids has to be an array even if it’s only one element, and you have to make sure that all the ids are integers.

    Hope this helps someone else.

    Very helpful for me!

    I am working on my website ( and I didn’t know how to insert a category, but now everything works fine.

    Thank you, fatalx!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Function to insert post into a category.’ is closed to new replies.