Regular post and custom post type permalink wordpress
-
Hi everyone i develop wordpress theme localy with xampp i changed the permalink to /%category%/%postname%/ and everythings working good however after i create my custom post type the permalink my regular post links give me error 404 page and my custom post type links working good and when i deactived my custom post type my regular post link working normal again, 2 days searching but without resolute .
Here is my custom post type code
<?php function name_post(){ register_post_type('name', array( 'labels' => array( 'name' => 'Names', 'wp_hours', 'singular_name' => 'Name', 'wp_hours', 'all_items' => 'All Names', 'wp_hours', 'add_new' => 'Add New', 'wp_hours', 'add_new_item' => 'Add New Name', 'wp_hours', 'edit' => 'Edit', 'wp_hours', 'edit_item' => 'Edit Name', 'wp_hours', 'new_item' => 'New Name', 'wp_hours', 'view_item' => 'View Names', 'wp_hours', 'search_items' => 'Search Names', 'wp_hours', 'not_found' => 'Nothing found in Database', 'wp_hours', 'not_found_in_trash' => 'Nothing found in Trash', 'wp_hours', 'parent_item_colon' => '' ), 'public' => true, 'has_archive' => 'name', 'public_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'capaility' => 'post', 'menu_position' => 5, 'rewrite' => array('slug' => 'name'), 'menu_icon' => 'dashicons-groups', 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'), 'taxonomies' => array('category', 'post_tag') )); } add_action('init','name_post'); function names_taxonomies(){ register_taxonomy( 'Country', 'name', array( 'label' => __('Conutry'), 'rewrite' => array('slug' => 'country'), 'hierarchical' => ture, ) ); register_taxonomy( 'Age', 'name', array( 'label' => __('Age'), 'rewrite' => array('slug' => 'age'), 'hierarchical' => false, ) ); } add_action('init', 'names_taxonomies'); function my_rewrite_flush() { my_custom_posttypes(); flush_rewrite_rules(); } register_activation_hook( __FILE__, 'my_rewrite_flush' );
The topic ‘Regular post and custom post type permalink wordpress’ is closed to new replies.