I was wondering if it is possible when creating the custom types, if when the post is published, it is automatically set a category?
I have created a custom post type : Green articles, and I can hide the categories, or show them. But I want the post to be added to the green category automatically?
Is that possible?
- Has been a member for 5-6 years
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 5 000 and 10 000 dollars
- Microlancer Beta Tester
- Bought between 10 and 49 items
- Referred between 1 and 9 users
I ask me the same thing.
Yeah, no one really has an answer for this….
I think it defaults to the first one, alphabetically.
I’m developing a real estate solution based on WP for a client and will look into this, since up until now I haven’t mingled with “categories” custom taxonomies (only tag-like).
Good thinking, I will also need to specify a default category, so hope it doesn’t only default to alphabetical
Is this the solution you’re looking for? http://www.wprecipes.com/add-categories-or-tags-to-post-programatically
Long live Google
So you basically just have to change that categories array to dynamically fetch the custom categories of your custom post type, right?
Looks simple, thanks redfactory!
Long live Google
So you basically just have to change that categories array to dynamically fetch the custom categories of your custom post type, right?Looks simple, thanks redfactory!
Haha no I actually follow their rss feed in my iGoogle You’re welcome!
Thanks for that. BUT That code requires knowing the posts id and then automatically setting that to have a specific category.
I dont know what my post id will be? How can I apply this to all the posts from a custom post type?
I’ll keep working at it.
OK, so I can pull all the categories in, and say which category ID to apply… BUT I can not apply that to my custom post type? I have to declare the post id? I dont know that yet and want to apply it obviously to more than one post, all the posts from the custom post i created.