I have the following code
$genres= array('action', 'comedy', 'horror');
foreach($genres as $genre){
$ret = wp_set_object_terms( $postId, $genre, 'genres');
}
But this code associates only horror as the genre. When I checked the DB too, I don't have a record for action and comedy. How do I associate all the three with my genre?
Thanks in advance.