I'm creating a wiki site using Bricks builder and Metabox. For this I have multiple CPT's, Relationships and Taxonomies set up. I'm also using the "Custom Post Type Permalinks" plugin to make permalinks a bit more attractive to the eye.
For the CPT "Skill" I enabled the option "Hierarchical". This is because some skills have sub skills. Which I want to indicate with the parent / child system.
This is where the problem starts to arise. Whenever I enable this option and updating the permalinks (twice to also flush) the page's stop working completely. I've spent a lot of time debugging and trying to pinpoint the issue but to no avail.
I noticed that this was also the case with the other CPT's, that when I enabled the "Hierarchical" option, it just stopped working on the front end.
Things I've tried:
I cannot figure out where the problem originates from aside from the Hierarchical option.
Help is highly appreciated!
You can try to deactivate the custom permalink plugin, re-save permalink settings (post name) or create a new CPT with the same settings to see how it goes.
Thanks for your reply. Please note the text "Things I've tried" and it's points.
I've already tried your suggestions.
Do you mind sharing the URL of any post of your CPT type where the problem can be seen?
Just tested and it works fine for me.
Ignore the time-wasting I did in the 1st video. I had a brain fade and forgot how to get the "<CPT> Attributes" meta box to appear when editing the entries.
Hmmm super strange.
Here's a full set up of my CPT and Character relationship:
I'm not sure where it goes wrong, but even after disabling the permalink plugin it doesn't work.
This is where the problem starts to arise. Whenever I enable this option and updating the permalinks (twice to also flush) the page's stop working completely.
Can you share a screencast showing the same?
You want a screencast of me showing when it stops working?
yes and also your Bricks template setup/structure and template condition.
Sorry if this is confusing for you. I mean creating a new CPT with a different slug and the same settings to see if it works.
MB Custom Post Types and Taxonomies use the UI to create the CPT as you do when registering the CPT with code https://developer.wordpress.org/reference/functions/register_post_type/
So I think it isn't an issue of Meta Box itself. You can try to deactivate all plugins except Meta Box, MB extension plugin, switch to a standard theme of WordPress and use the function
flush_rewrite_rules() at the
init hook to see if it helps.
Also, thanks for your support, Sridhar.
Here is the video you requested:
Hopefully my set up makes some sense.
I've played with all the possible checkboxes, but to no avail.
"This site can’t provide a secure connection
streamable.com sent an invalid response.
Also, do not forget answering https://support.metabox.io/topic/hierarchical-post-type-causes-404/#post-43684.
Strange that the streamable link doesn't seem to work for you.
Maybe try this link instead:
Thanks for your replies!
The answer has been found by Anh Tran.
The CPT option: Query var needs to be enabled, after this the CPT Permalinks plugin needs to be disabled and permalinks need to be saved twice.
The CPT Permalinks plugin does not handle child CPT's well. However, this didn't explain the post still not working after disabling the plugin, that issue lays in the Query var option.
Same issue with hierarchical pages, only solution was not to use metabox to do it and handle my pages hierarchical structure using the post type type SLUG as a repertory name, Prepended permalink structure and Enabling request the post via URL. In that case the rewrite rule works without getting 404 errors for pages that were already fine in this repertory before using metabox for other pages. Trying anything else either makes pages not built with metabox go in 404 or new pages built with metabox go on 404. No way to get both running fine before, now it is ok but required couple of days to get right.