WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Grandchild pages/permalinks 404 error (6 posts)

  1. Elliott Stocks
    Member
    Posted 1 year ago #

    Hi,

    I've noticed that when adding a grandchild page under a parent of /events/ the page is "not found" and returns a 404 error e.g.

    /events/an-event/event-info

    If I change the permalink slug "Events" from events to events/ (note the added /) this fixes the above error, but then breaks child pages of events e.g.

    /events/an-event this URL is now /events//an-event where as the above grandchild slug doesn't have the double slash //

    Has anyone else noticed this problem or have any advice on how to solve it?

    I've disabled other plugins and the problem only occurs when events manager is enabled.

    Appreciate any advice,

    Thanks !

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    due to the way permalinks work, we have to hard code rules for child pages of the events page, I haven't done that for grandchild pages

    something we could look into in the future but I think your best option right now is to not use grandchild pages under the same slug as your events are shown.

  3. Elliott Stocks
    Member
    Posted 1 year ago #

    Thanks for your quick reply, this is on a clients website so I wanted to get it working. I took a look at the code and made some changes in /classes/em-permalinks.php about line 22

    You can view the changes on github

    After flushing the rewrite rules it seemed to work fine! If possible could you take a look at the code and let me know if that seems correct to you?

    Thanks :).

  4. Elliott Stocks
    Member
    Posted 1 year ago #

    Sorry I meant line 99 ;)

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    yup, that looks right to me. You may want to look into adding this outside the em plugin using hooks (like we do on that file)

    so it's upgrade safe.

  6. Elliott Stocks
    Member
    Posted 1 year ago #

    Will do :) You could always add it into the core and save me the trouble haha

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic