I have a custom post type called “events”. When I create an event that has a child, the child URL always 404’s. Example URL:
Query Vars is set to true; I’ve reset my permalinks more times than I can count. Have looked at Rewrite Rules Inspector, and the top rule that comes up when testing a link like the above is as follows:
events/(.+?)(/[0-9]+)?/?$ index.php?events=$matches&page=$matches events
I’m outputting the query data, and am getting the following:
[query] => Array
[events] => eventname/child-event
[post_type] => events
[name] => eventname/child-event
[queried_object_id] => 0
[request] => SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = ‘0’) AND wp_posts.post_type = ‘events’ ORDER BY wp_posts.post_date DESC
It’s like the query is just flat out ignoring the query vars. I’ve looked in the DB, and the post_name is listed as “child-event”, so it seems like if it was searching under the name, it wouldn’t find it anyway…
Any help is appreciated.
- The topic ‘Hierarchical links not working’ is closed to new replies.