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
- Menu item on a category
- Showing categories and subcategories with posts
- Change default category when I publish a post
- Loop parent terms {display posts} AND loop child terms {display posts}
- store posts_id of category into a varable?
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- How to show show the Second page title in the page
- How to get links to the last N posts in a specific category?
- Loop doesn’t exclude the specified category in home page
- Display posts of specific category term
- Create a list of posts with topic headdings
- Widget that shows categories with posts numbers
- How to create a sub post?
- Post Image not displaying in category view
- relating business and products with custom taxonomy?
- Is there a query string for edit.php to show all posts that have no custom taxonomy terms?
- How do I show posts from another wordpress installation?
- get posts from Custom Post Type & Category
- Blog post not showing title
- Category page when using static front page
- Latest posts by category — how to exclude current post?
- How can I remove the first two words and shorten get_the_title()
- Relative number of post in category
- How to create a “latest news” page showing a list of posts from blog category
- Exclude some categories from listing on the current post
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- how to hide empty fields of post category description?
- how can i display my posts alphabetically?
- if in category but only with post meta
- How to get post with associated categories and tags names instead of ids with rest api?
- How to style archive post titles… but only those posts who have comments?
- Replace image name on upload to the new post name on front-end form
- Edit the post title from the frontend
- Display a mixed list of posts and media
- Why in my query is display two title?
- Migrate posts from category and sub-category via SQL
- Parent category / child category posts
- Posts Missing in Dashboard after update
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- Sort by last word in title
- Display post number by category
- Image behind the post’s title
- singular posts using archive styling
- Display selected categories onto post page
- How to call posts under a specific category on static front page?
- Give posts a particular template based on the assigned category
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page
- How to remove “» (title of post or page)”?
- Extract wordpress posts content and category content
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- How to get post with slug and exclude categories
- Auto update post title and slug when post status is changed
- All categories displays the same posts
- Having pages after specifying post_type post
- In what context should Categories and Tags be used
- Exclude post category in a blog page
- Show posts on front page only
- list posts from two categories on a page – plugin not working
- Get featured image on hover of post title [closed]
- Retrieving posts by their date and category
- Get latest post from categories
- How to create a playlist for audio associated with posts per category
- Are post, page and category IDs unique to each other?
- Microformats in a single post – layout conflict
- Change the background of each post according to the category
- Static pages not working
- Post-Archive like a page in a specific subdirectory
- Programmatically add posts from specific category to menu
- WP_Query of Category Not Showing First Post
- How do I display the post_title with get_permalink?
- Post is in descendant category not working in home.php
- WordPress displays post on subcategory only
- How to get posts ordered by using their categories?
- Remove Featured Image from posts in specific category?
- Post titles and thumbnails as links to custom post types?