0

I have two (almost) identical wordpress websites. A devel/local and a production/remote. I have a custom post type "event" created through Meta Mask on both instances. I want to render a template "archive-event.php" by adding a "/event" request in the browser. The devel instance renders the archive-event.php well. The production instance renders a 404.php template, although the archive-event.php template is in the right place.

Query Monitor shows this:

Devel

Overview

GET http://[local site]/event/ → 200

Request

event
Matched Rule

event/?$
Matched Query

post_type=event
Query String

post_type=event

All Matching Rewrite Rules
event/?$    post_type=event
(.?.+?)(?:/([0-9]+))?/?$    pagename=$matches[1]
&page=$matches[2]
(.+?)/?$    category_name=$matches[1]

Prod

Overview

GET https://[remote site]/event/ → 404

Request

event
Matched Rule

(.+?)/?$
Matched Query

category_name=event
Query String

category_name=event

All Matching Rewrite Rules
(.?.+?)(?:/([0-9]+))?/?$    pagename=$matches[1]
&page=$matches[2]
(.+?)/?$    category_name=$matches[1]

How can I trace where is the conflict or another difference?

5
  • 2
    If you registered the post type with a plugin then it's probably configured differently on each. Archives need to be enabled for the post type. In code that's making sure that has_archive is true, but if you used a plugin you'd need to ask its author how to do this. Third party plugins are off topic here. Feb 1 at 9:33
  • Actually there's no difference between creating a custom post type through Meta Box and through plain WordPress. It's just a code generator, so we can consider it a pluginless way. I will check the has_archive, thanks for your tip. Feb 1 at 9:49
  • No, it isn't a has_archive issue. It seems to be a slug conflict. ?post_type=event works well. Feb 1 at 10:01
  • Did you re-save permalink settings on the prod site?
    – kero
    Feb 1 at 10:17
  • Bingo! I re-saved the permalink settings and it is working well now. Thanks for your help. Feb 1 at 10:23

1 Answer 1

1

The issue was caused by missing permalinks for the new content types. Re-saving the permalink settings helped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.