Change Category (Taxonomy) URL

Home Forums Calendar Products Events Calendar PRO Change Category (Taxonomy) URL

  • This topic has 9 replies, 2 voices, and was last updated 9 years ago by Mister.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1254799
    Mister
    Participant

    Hi,

    as default, the event categories taxonomy use the following URL
    /events-url-slug/category/my-category, e.g.
    /events/category/my-category

    Is it possible to change this URL structure to
    /new-category-slug/my-category

    I.e. that the events URL slug and the “category” from WordPress are not used, but instead a custom own slug?

    #1255330
    Shelby
    Participant

    Hey Mister,

    Thanks for posting, & I’m happy to help answer your question today. 🙂

    Unfortunately, this kind of request would require some plugin customization, which we can’t support on these forums. We have some guidance for working through making changes like this  here and here. If you need to find someone to help with the customizations, we also have some tips for finding help here.

    Hope this helps, and let us know if you need any clarification on these resources. 🙂

    Thanks,

    Shelby

    #1255334
    Mister
    Participant

    Hi Shelby,

    This is pretty basic theming documentation and function reference which I all know.

    I know that this requires to dive much deeper, but I would need to get a hint or a starting point. Please can you share a bit more information where and how events calendar handles the custom taxonomy registration, so that I can figure out if there are any hooks to overwrite the URL structure?

    Thanks.

    #1256016
    Shelby
    Participant

    Hey Mister,

    No problem! Let’s see if I can get you on the right track. I think you may find George’s comments in this thread helpful for getting custom taxonomies set up. 🙂

    If your inquiry is primarily related the the URL structure though, you may want to check out our Relabeler Extension. 🙂

    Let me know if that helps, or conversely, if it wasn’t quite what you were looking for.

    Thanks!

    Shelby 🙂

     

    #1256588
    Mister
    Participant

    Hi Shelby,

    unfortunately both links are not what I am looking for.

    As mentioned in the first post, what I want is to get rid of the “/events/category” in the URL, but only for the Events Categories, and then instead use my own slug.

    Another example:
    /events/category/baseball => becomes: /activities/baseball
    /events/category/football => becomes: /activities/football

    I think the only way to do this is by adding some functionality into functions.php. However, I need to find a starting point, e.g.

    • Is there a filter or an action on Events Categories taxonomy registration, where I can jump in and modify the URLs
    • If not: Can I catch the URL calls and redirect them to some other URLs and how would I create them?
    #1256845
    Shelby
    Participant

    Hi Mister,

    Thanks for clarifying! That example helps. You can change the root of the URL through a built in setting found at:

    Events>Settings>General> “Events URL slug”

    Beyond that, you can set the category names to achieve a label like “baseball.”

    Does that make sense?

    Best,

    Shelby 🙂

    #1256848
    Mister
    Participant

    Please re-read my posts more carefully.

    I do not want to change the events URL slug in general. I would know how to do this.

    What I want is to ONLY get rid of the “/events/category/” for Event Categories.

    I.e. I want to have:
    Calendar URL: /events/
    Event Category Baseball URL: /activities/baseball
    Event Category Football URL: /activities/football

    • This reply was modified 9 years, 1 month ago by Mister.
    #1257674
    Shelby
    Participant

    Hi again,

    So, after conferring with my team, I’ve confirmed the following:

    You’ll want to review the Tribe__Events__Rewrite class found in src/Tribe/Rewrite.php and pay attention to references to the 'tax' (taxonomy) base and the filters we provide in that file to make these kinds of changes. It was also suggested that you might use the ‘tribe_events_category_slug’ filter. In either case, you’ll need to flush your permalinks after.

    It’s also worth noting, that changes like this will require a good knowledge of how rewrite rules/permalinks are handled in WordPress, so you’ll want to make sure you’re working with your own developer, as the specifics of making these changes are beyond the scope of support for this plugin.

    Hope this helps, & best of luck with this project! Please feel free to reach out to us in the future with questions about our plugins.

    Cheers!

    Shelby 🙂

    #1268941
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Change Category (Taxonomy) URL’ is closed to new replies.