Error 404. Weird behavior with CPTs
-
Hi
I have a simple CPT called “test” created on functions.php:
$labels = array(
“name” => __( “Tests”, “fc-custom” ),
“singular_name” => __( “Test”, “fc-custom” ),
“menu_name” => “Tests”,
);
$args = array(
“label” => __( “Tests”, “fc-custom” ),
“labels” => $labels,
“description” => “”,
“public” => true,
“rewrite” => [ “slug” => “test-single”, “with_front” => false ],
“publicly_queryable” => true
);
register_post_type( “test”, $args );I created a post titled “New test post” to test it which generates this permalink: https://dev.formulaclick.com/nemux/test-single/new-test-post/ but throws 404 error.
I have flushed permalinks updating wp-admin/options-permalink.php but still 404 remains. I’ve tried also flushing rules using a snippet but same result.
If I just install your plugin, without touching nothing… IT WORKS! But I can’t understand why. Permalink structure is the same on php code and in your plugin. I prefer using php code to manage permalink structure instead a plugin.
Do you have an idea what problem can I have on my database or something?
Thanks a lot!
The page I need help with: [log in to see the link]
The topic ‘Error 404. Weird behavior with CPTs’ is closed to new replies.