• Resolved a0394

    (@a0394)


    Hi, i’ve got a question related to CPTui:
    I’m creating a website for an association that organizes different courses for different sports (basket, volley, calisthenics, ballet).
    I’ve been following some tutorials – this one in particular:

    Now as he does i’ve created the CPTs i need (one for each sports, so Post Basket, Post Volley etc). The problem is that each sport will need to have two different post archives, one with news and one with events (so i’ll need basket news&basket events ->under basket; volley news&volley events->under volley etc — sorry for the redundant examples but on reddit and so on i haven’t got anything useful yet).
    I’ve then created a taxonomy that applies for every post type, which has two options: News or Events.
    And it’s hierarchical of course.
    Creating the post types and assigning their slug to the menu via custom link now poses the following problem: *there’s no archive page*, only the single post page and the url is like this: mywebsite.ext/basket/post-name, while it should be mywebsite.ext/basket/news(or events)/post-name.
    What would be the correct solution? Should i build regular pages for each sports? And then if so how could i have two archive child to each sport (events and news)?
    Please keep in mind that i’ll have to build a front-end dash for my clients with ACF Frontend, so the simpler the whole thing is organized the easier will be for the client to use the dash (and simpler for me to set up too).
    I’d like to avoid having a dozen buttons like “add basket event” “add basket news” “edit basket event” “edit basket news” and so on for each sport.
    It would be better to have just two options for each sport, like add and edit, and then somehow inside having the choice between event or news post.
    I hope i’ve been clear enough, i’m really having an hard time with this lol.
    Anyway many many thanks to whoever might want to help!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    For what it’s worth, this is a topic that covers more than what CPTUI alone handles, which is registering post types and taxonomies.

    I feel like what you’re ideally wanting is for these two url structures to show archives of posts. These two below would be term archives for posts that have either an “events” term assigned or a “news” term assigned.

    mysite.com/basket/events/
    mysite.com/basket/news/

    and so on with other sports.

    Then perhaps have permalinks like this lead to the posts for events or news:

    mysite.com/basket/space-jam-tournament/
    mysite.com/basket/michael-jordan-returns/

    This permalink below doesn’t make as much sense as to me it looks like a single post that happens to have either the phrase “news” or “events” in it. While that would likely be dependent on the term assigned, it’s still just inserting the term into the permalink for a single post. Not so much an archive. May be the case where you want the event or news value inserted.

    mywebsite.ext/basket/news(or events)/post-name

    Am I generally accurately following thus far?

    I’ve never tried it before, but I am curious if this could be done above where both a taxonomy and a post type share the same slug, and WordPress is just smart enough to differentiate accurately.

    Thread Starter a0394

    (@a0394)

    Hi, thanks for your reply. I need the url structure to be mysite/basket/news/post-name only for logical reasons, as the /news/ related to /basket/ would be the “parent level” of /post name.
    What i still don’t get is, how can i have those two /news/ and /events/ if i create a static page (/basket/) and then a single archive?

    Thread Starter a0394

    (@a0394)

    Hi, any news? As i said i’d like to have the following:
    sitename/activity/news*OR*events/post-name

    /activity/ is a static page that displays some info and then 3 articles for “news” and 3 for “events”

    Hence both “news” and “events” have their own archive, and below the 3 articles in the /activity/ page there’s a button “View more” that takes you to activity/news or activity/events.

    How can i achieve this? It should be easy, but it’s been driving me mad for weeks.
    THX!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not really any news or developments on my end. I also don’t have any new information to try and send your way.

    One of those things that sounds easy in theory, but as we’ve discovered here, actually not.

    The thing is that you have these permalinks that are a mixture of page, taxonomy term, and single post slug, in terms of what each portion is meant to represent, and each technically dictates what WordPress tries to display.

    Permalink customization has always been a very interesting task to tackle consistently and across the board.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Ever get this one resolved @a0394 ?

    Thread Starter a0394

    (@a0394)

    Hi Michael, thanks for your replies. In the end i just created a page for each activity (eg. /basket/) with two child pages each (eg. /basket/basket-news/ & /basket/basket-events/) with relative posts assigned to them. Not the cleanest solution i reckon, but it did get the job done.
    Thx

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Job done is better than spinning wheels for forever.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘CPTui – Hierarchy’ is closed to new replies.