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?
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?
Share Improve this question asked Feb 1, 2022 at 9:28 Robert ZelníkRobert Zelník 1911 gold badge1 silver badge5 bronze badges 5 |1 Answer
Reset to default 1The issue was caused by missing permalinks for the new content types. Re-saving the permalink settings helped.
has_archive
istrue
, but if you used a plugin you'd need to ask its author how to do this. Third party plugins are off topic here. – Jacob Peattie Commented Feb 1, 2022 at 9:33has_archive
, thanks for your tip. – Robert Zelník Commented Feb 1, 2022 at 9:49has_archive
issue. It seems to be a slug conflict.?post_type=event
works well. – Robert Zelník Commented Feb 1, 2022 at 10:01