create category for custom post type
-
Hello
I want create custom category for custom post type so it’s possible using this plugin and how?
Because when i create custom Taxonomies so it’s create like a tag not category.
Please tell how can i create custom category using this plugin
-
Set your custom taxonomy to be hierarchical, and it should start behaving more like a category and not a tag.
Hi Michael,
I actually need to ask about this.I have just created a Taxonomy called ‘UK’, and set it to Hierarchical.
However, I notice that when I go to one of the CPT pages, it asks me to type a new taxonomy name under the Taxonomy title, ‘UK’.
What I need is to put a load of CPT pages inside one category, which would be the name of a country. I don’t need to create subdivisions of a taxonomy title.
I am trying to achieve something like this:
www.mydomain.com/uk/professionals
If I’m able to do this, it will enable me to put some professionals in one category, like ‘UK’, and another lot in another category, like ‘Ireland’ etc.
The category would also ‘ideally’ function as a Page / Mini-homepage.
… Is this possible please?Thanks for reading
It should be possible. My first hunch is to make the country name the parent term, and then the subdivisions be child terms. I believe you should be able to get the URLs desired that way for the archive links as well. Worth tinkering around with.
Thanks for replying.
When you say ‘parent term’ are you referring to some type of Taxonomy or Category?When you say ‘tinkering’ I am under the impression that you are referring to writing code.
Do you know of a plugin solution for this please?If plugins aren’t available for this problem, and if code doesn’t do it in a stable a clean way, I can see myself trying multiple WP sites – one for the root folder with some generic pages incl. main home page, and another install in a directory …/uk/
Consider the fact that “Categories” in WordPress is a taxonomy, as is “Tags”. Any time you add a new tag, you’re adding a new tag term. “Actors” would be a taxonomy that would be well fit for a “Movies” post type. Once you add “Brad Pitt” to a movie post, you added a term to the “Actors” taxonomy. To give an example of a parent/child relationship. You could create some parent terms of “male” and “female” in the “Actors” taxonomy and assign specific actors to each based on gender.
For the tinkering bit, that doesn’t necessarily mean code, it could be tinkering with settings as well as term assignment for posts in what you’re working with. Shouldn’t need multiple sites to achieve this. It should all be possible to get set up in one install.
Thanks for explaining.
I created a Taxonomy called Country. I then edited one of the CPT pages and added ‘UK’ under the ‘Country’ taxonomy.I tried with taxonomy hierarchy set to both True and False, though I found that mydomain.com/uk/ did not find a page on the site.
– When I had a Category called ‘uk’, adding this after the domain always found a page, but it seems not with taxonomy.Also, I wouldn’t want users to be able to create their own taxonomy, ideally they’d have to choose one from a dropdown menu, and not ‘None’.
So far, each professional has their own unique CPT, to make their page, which also limits their access to other areas of the site.
– My problem is, how do I bunch them all under ‘/uk/’?If I had 5 professionals using the site, their URLs would look something like this:
www.mydomain.com/uk/john-smith www.mydomain.com/uk/sally-ferguson www.mydomain.com/uk/brian-jones www.mydomain.com/uk/martin-kessler www.mydomain.com/uk/caroline-rosselli
Also, ‘www.mydomain.com/uk’ would be a WP page where I would add my own content.
Any thoughts on this would be great
Sadly, at least out of the box, there’s no taxonomy archive for all terms in the taxonomy, which is why you likely got the 404 for .com/uk/, Once you get some terms made, you can visit .com/uk/term/ and it should work. That said, you may not need to worry too much about the parent/child stuff I mentioned before, as I forgot at the time that the taxonomy is part of the url, and could act as visual hierarchy.
Are these users going to be doing this from the frontend via user-submitted content? or just people you have available creating posts from the WP Admin? If the former, then it should be possible to create a list of specific ones, and not let them add any more from the frontend.
Regarding the last part, it sounds like the “uk” part may almost be better done as a post type. Users submitting content for a profile of sorts makes better sense as a post type than a taxonomy term.
One of those issues that has many potential solutions and pros/cons for each.
Thanks Michael.
To answer your Q, the users will be accessing the WP Dashboard to create their content, but with limited access – thanks to the CPT Plugin settings.
I chose CPTs to make it as easy as possible for users to edit content, with minimal tech know-how.
As for User Submitted content, I have just checked out some plugins here: https://premium.wpmudev.org/blog/wordpress-post-frontend-plugins/
have tried No.1 in the list “USP (User Submitted posts)”, but it doesn’t seem to be quite detailed enough, as I need my users to be able to log in to an ‘account’ with their own user avatar, and edit their existing content, etc.– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
On the subject of CPTs, I have created one called ‘uk’.
Though unfortunately, as with all the other CPTs, I cannot see where to specify Page Attributes: Parent.
This seems to be possible with Posts (and Pages thanks to a plugin), but not with CPTs.
– And even if I could assign one CPT Post as a Parent of another, surely I wouldn’t be able to assign a post of one CPT (called ‘John Smith’) under the post of a completely different CPT (called ‘UK’) – ?From what I can see, it seems the next thing is to try and get Categories showing up in CPTs. Then I (Admin) would ideally set the categories for each CPT user, without anyone else being able to do this.
That way, I could assign a load of CPT users to one Category, ‘UK’.I would like to be able to do this without using multiple WP installs, but so far… I cannot see another option.
The parent page attribute stuff should show up if the post type is hierarchical.
Cross-post type associations aren’t something out of the box, but I know there’s the posts-2-posts plugin that sets up that type of thing. Not sure about parent/child relations though.
Just associate the category taxonomy to the CPT.
Still should be possible with one install.
Hi,
I have been continuing with the experiment.Thanks for mentioning the plugin ‘Posts 2 Posts’. I have been able to link some Posts to some Pages, but alas not to a CPT.
Also, despite being able to link a Page and a Post in the dashboard area, I cannot see how this plugin affects the pages when viewing them in the normal way. And, no changes to the URLs.
My dashboard is starting to look like plugin-soup with all the various things I’ve tried. I have a feeling that a dev customisation of the Categories – perhaps the development of a Super-category, as in categories within categories, will be the way forward.
Thank you for your suggestions anyway
- The topic ‘create category for custom post type’ is closed to new replies.