ucarman2002, just as a quick check, did you make sure your registered CPT is set to have archives? It’s one of the “advanced options” that are available by clicking the link below the initial 4 inputs.
hello
all registered CPT set to have archives true
not sure at this point, ucarman2002, sorry. Maybe someone else has an idea.
Your Custom Post Type has to have Archive set to true to enable Permalinks.
To update the Permalinks structure you can add the following function to your functions.php file:
// ==============================================
// Flush Permalinks on Save Post
// ==============================================
//Create a Function to Flush Permalinks
function nr_flush_permalinks() {
/* Call WordPress rewrite function to flush rules.
http://codex.wordpress.org/Rewrite_API/flush_rules */
$wp_rewrite->flush_rules();
// Do anything you wish to do more....
}
//Add Function "n_flush_permalinks()" to the "save_post" action hook:
add_action( 'save_post', 'nr_flush_permalinks()' );
for anyone stopping my and seeing this thread, while Antonio does have the right idea that you need to flush your rewrite rules when you register new posts types or taxonomies, I’m not sure having them flushed every time a post gets saved, which can be quite frequently. This would cause a lot of overhead. Also just visiting the permalinks settings page is supposed to flush them as well, and nowhere near as frequently as the save_post hook.
I have a similar issue, took me a while to nail it down to Custom Post Types UI but that definitely seems to be the cause.
Scenario: site under development with 3 Custom Post Types + 4 Custom Taxonomies.
Everything was working fine, with /%postname%/ permalink but somehow something happened, most likely after adding the 3rd post type.
Now the /%postname%/ permalink does not work, it results in most pages (normal pages, not posts – but strangely enough not all of them) going to the posts ‘Home’ page (not 404).
The ‘default’ permalink is working fine, so does the Numeric ‘/archives/%post_id%’ permalink that I am using now.
I have tried different ways to correct this:
– not a theme issue: also happens with default WP theme
– not connected to another plugin as it also happens with all plugins (except CPT UI) disabled
– even moved a copy of the site to another server: still same issue
– archiving for CPT is on
– changed page names with possibly permalinks conflicting with CPT
– checked .htaccess file
I see that you are looking for beta testers for 0.9 version; could that version possibly address this issue ?
At the time of the posting, I definitely was looking to be looking for beta testers, but sadly I fell off the wagon completely with 0.9 since then, due to other work in-company, and I haven’t touched the plugin since January. So as it stands, i’m still going to be looking to look for beta testers, but it’s still not at a point of being in beta 😐 So much refactoring 8-|
I found the cause of my permalink problems.
Not so much the plugin itself but the fact that I used ‘year’ as a slug for one of the CPT’s. I now know that this slug should not be used and is reserved for WordPress (http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms).
You might want to build in some sort of alert for the users of the plugin in a next version to avoid them making the same mistake.
Good to hear that you got that resolved. I’ve made a github issue for myself to remind me to do something about that list of reserved terms, if I haven’t done something already with my beta copy.