0

我做了一个新的自定义帖子,如下所示:

register_post_type( 'news',
            array( 
            'label' => __('News'), 
            'public' => true, 
            'show_ui' => true,
            'show_in_nav_menus' => false,
            'menu_position' => 5,
            'rewrite' => false,
            'supports' => array(
                    'title',
                    'thumbnail',
                    'editor',
                    'excerpt')
                ) 
            );

但是当我尝试发布网址时,它看起来像以下 http://domainname.com/?news=post_title

我希望网址像 http://domainname.com/category/title

所以我通过将重写更改为尝试以下帖子,array('slug' =>'title', 'with_front' => true) 但是当我这样做时,它给了我 404 page not found

这里有什么问题 ?

4

1 回答 1

0

Yes i knew what was the problem you have first to reset the permalink to default then create a new post type with rewrite then make it back to /%category%/%postname%/

于 2013-02-28T14:13:41.367 回答