• Resolved yucelm

    (@yucelm)


    Hi,

    I have created 2 customs post types “Products” and “Services” and also created some custom taxonomies as well. I made both taxanomies and post types “hierarchical” and followed the tutorials. However, when I create a new post type, my taxonomies don’t populate on the right side as “select boxes” would do on a normal page.

    Sorry I am new to this concept but I have another simple question. The purpose of creating “hierarchies” is to do custom queries for archive pages correct? what is the point of having a hierarchy for the taxanomies? only for better organizing them? or is there another reason?

    Also, does it make a difference if I create the CPT first or the taxanomy first?

    Many thanks…

Viewing 12 replies - 16 through 27 (of 27 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    customizing rewrite rules is still far from my strong suite which I should really look into changing given how many permalink questions I get.

    You’re going to have an interesting time with 3 different things expecting “/products/” as part of their URL.

    This one, for example: https://www.mysite.com/products/paints/product-1

    should it be 3 nested pages?
    should it be 2 nested posts in the post type?
    should it be 2 nested terms in the taxonomy?

    I don’t know, and depending on the rewrite rules saved, WP probably doesn’t know for sure either.

    Thread Starter yucelm

    (@yucelm)

    Hi,

    Actually I am sure it is possible but no one seems to have done it this way.

    This one: https://www.mysite.com/products/paints/product-1

    /products: a page with some UI cards (each card corresponds to one custom tax. term)

    /paints: custom taxonomy term – all single custom posts types attached to this term shows up here

    /product-1: single custom post type (single product)

    First two steps are ok, I am only having an issue with the last step. When I click the single post type (product), it says “not found” but the product exists. So it just cannot find it.

    Really frustrating process.

    ADDITION: It will be one custom post type under a custom taxonomy. Normally it works fine (if I leave the custom taxonomy slug as “product_categories”) but I did re-write the slug as “products” because that’s the URL I want to show.

    • This reply was modified 4 years, 2 months ago by yucelm.
    • This reply was modified 4 years, 2 months ago by yucelm. Reason: addition
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    That’s the thing though, is that each part of the URL is trying to tell WordPress what to query for. It doesn’t just automatically know. Chances are the “product-1” part is being interpreted as a child term, as opposed to the individual post type post slug. Impossible for me to tell from here, without access to the parsed query. However, I know that I’m a big fan of https://www.ads-software.com/plugins/query-monitor/ for debugging purposes and it can reveal a lot of information about what’s going on for you.

    Thread Starter yucelm

    (@yucelm)

    Hi again ??

    I sort of understand what you mean, since I am not a expert on this subject matter.

    What do you think would be the best way to accomplisg this? Because I have seen WP sites with the same hierarchy.

    I have also drew a simple diagram to better explain the situation you. As I may have missed some details!

    Here it is: https://drive.google.com/file/d/1F8ktJ9ON0siWQrsT3z2lbwNPQhsCkiqf/view?usp=sharing

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I understand the goals and everything, i don’t have a great answer or place to point you to to achieve it though. CPTUI is only a small part of the overall end result, which is registering the content types.

    I also get and believe that you’ve seen similar URLs, but the question I’d have is are they all representative of ‘/page/taxonomy-term/single-post/’ or are they for example ‘/taxonomy/taxonomy-term/single-post/’ or ‘/post-type-slug/post-parent/post-child/’ or any other mixture, and how easy was it accomplished.

    If you know of an example site that you for sure saw this at, wouldn’t hurt to reach out and ask them how they achieved it. Perhaps they could share plugins or code snippets that helped them? Who knows.

    Thread Starter yucelm

    (@yucelm)

    Thanks so much for the effort. I really appreciate that.

    Thread Starter yucelm

    (@yucelm)

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I can’t stop it from working if it does, but it’s definitely an approach that I disagree with. It’s overloading the post type slug rewrite parameter with more than it should be, in my opinion. The moment you’re separating anything with a / in the rewrite, it’s doing too much. The spot, by my understanding is meant to just affect “projects” from the post, not add in other URL parts for completely different parts of data that needs parsed out.

    Like I said though, if it works and fits your needs, go for it. ??

    Thread Starter yucelm

    (@yucelm)

    Well, I am also searching for the best possible solution and I am not so keen on this “hacky method” either. However, “products/category/product-name” should be possible somehow.

    I have spent way too much for this issue and still no avail, how come am I the only one with this problem? Don’t pople nest their custom post types with custom taxonomy?

    Some travel sites have urls like europe/germany/berlin/somehotel etc… for example.

    But howwwwwwwwww? ??

    Btw, I really appreciate the help and if you accidentally come across any “more elegant” solution, please let me know…

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Ideally I’d love to remember to find the time to do trial/error and work out what I consider to be a good “clean” solution and create a tutorial out of it.

    I guarantee you’re not the only one who’s wanted such things. I blame the WordPress Rewrite API more than anything, and that’s not a simple thing to work with.

    I wish people who found solutions would blog about them more ??

    Thread Starter yucelm

    (@yucelm)

    Well, if you decide to do a tutorial on this issue with a clean and functional approach, I am sure many people will love you for it ??

    I have also come across this on YouTube: https://www.youtube.com/watch?v=ECFVrBoQYRw&feature=share

    From technical standpoint, I am not sure if it overloads any part of WP core more than necessary or, even if it is the best approach or not but, since you know a lot more then about me on this subject matter, I thought you may wanna check this out.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Bookmarked for future viewing, thanks.

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Taxanomies not showing up on CPT’ is closed to new replies.