Can’t give you fish, but I can try you to teach how to fish with a couple of pointers;
- hook into publish_post (good example code there) and / or post_updated
- in the function that is called that way, use wp_create_category (which will only create if the cat. name doesn’t exist yet)
- and with the cat ID you get that you then call wp_set_post_categories (make sure to set the 3rd param to true)
happy coding! 🙂
frank
Related Posts:
- Get Posts Under Custom Taxonomy
- Different post sort order within different categories
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- How do I get the slug of a custom taxonomy category of a post?
- Add Category name to Post Title (h1)
- I want to show category in the post title , how can I do
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Get Posts Under Custom Taxonomy
- Prepending %category% onto default posts fails
- How can I setup a relationship using categories in WordPress?
- How can I hide tags on a child-category page, if that tag has not been used?
- How do I include the category next to the title of a post?
- WordPress bulk category select when publishing post
- Change Post Title For Specific Category
- Unable to differentiate between two categories under custom post type on single.php
- Geting error in post and category [closed]
- How to select a category automatically based on a word in WordPress post title?
- Page with Category Returning 1
- Post Category link is same with Page link
- How to get post count including nested categories
- Is it possible to have different header style blog titles in different categories?
- Taxonomy Category category.php not working
- How to add metabox for post of specific category
- Manipulate post category after time
- Dynamically update post title in admin page
- Categories box not showing on post edit pages
- List only child categories a post is in, of a specific parent category
- Add custom field to all posts in specific category
- Exclude category on blog list page
- is there a better way of combining this?
- wp_list_categories link to first post of category instead of calling taxonomy template
- Displaying Page Title on index.php
- How to Add ‘Post Categories’ to the Dashboard Sidebar
- How only display all post related to category
- Using Custom Posts with Metaboxes and Drop-downs
- How to add a custom field after wp post
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Add category to all post by using sql query?
- How to prevent WordPress from updating the modified time?
- Full Width Main Post
- Direct link to “New post” in specific category?
- Pass data between pages
- How do I retrieve then print the currently viewed sub categories?
- Pulling in post category and children within category
- Post categories to pages
- WP_Query: Mixing category__in and tag__in together
- If in_category not working for multiple single.php pages
- Set Default Category to Username
- Listing Specific Categories from Current Post with Depth
- Display post category in foreach loop
- Single.php – Get Current Parent Category
- get_the_category listing in hierarchial order
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- outputting posts’ taxonomies: cant get ‘get_the_taxonomies’ working
- How show categories in admin and get that selected to show posts in index
- Create a list of posts with topic headdings
- if in category but only with post meta
- singular posts using archive styling
- Display selected categories onto post page
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Show posts on front page only
- Get featured image on hover of post title [closed]
- Change the background of each post according to the category
- Programmatically add posts from specific category to menu
- Get post category as a separate string and url
- How to show category based post in home page?
- How to view all posts (on site, not admin) that are uncategorized?
- How to create a list of links to post with specific category
- Post meta not working
- get category in list of posts // shortcode for custom related posts
- Featured Story Shortcode not outputting content
- How to add a ‘News’ section to specific posts in WordPress
- Get Category in save_post Hook
- How to make a page show posts only from specific categories without editing php files
- Get posts from category from custom query
- My posts page is missing the page title
- How to show posts ordered by random [duplicate]
- How to Get Position of a Post from a category and tag
- Display new posts categories in separated divs
- Add Categories To Custom Post
- Query posts from newest category
- Display Posts by Categories
- Ajax – Post Categories and Load More
- Edit Posts Page but not category specific pages?
- Add category selection to function request
- Show Post number of specific Category
- Custom Post Type used for FAQs Accordion
- prevent same wordpress post title
- How to organise post by category and date
- Show post if in category
- How to display custom content in post with category XXX
- Displaying categories items among posts
- Displaying different posts Via wp_list_categories()
- Category pages vs single post pages
- retrieve post slug by post_tags taxonomy
- Display ONLY Latest Post From Several Categories
- Show all posts in category
- Polylang – display one post into 3 categories with different lang [closed]
- Export Posts Without Categories In An XML File