自定义帖子类型永久链接删除


Custom post type permalink remove

我想删除permalink的自定义post类型名称。

我创建了一个自定义的帖子类型如下:

    add_action( 'init', 'register_projects' );
    function register_projects() {
        register_post_type( 'proyectos_post',
            array(
                'labels' => array(
                    'name' => __( 'Proyectos' )
                ),
                'public' => true,
                'supports' => array( 'title', 'editor'),
                'hierarchical' => true,
                'menu_position' => 4
            )
        );
    }

问题是,当我输入一篇帖子时,url会得到:www.myweb.com/proyectos_post/mypost

我希望它是这样的:www.myweb.com/mypost

在没有外部插件的情况下可以做到这一点吗?

试试这个。'rewrite'=>数组('slug'=>'custom-post-name','with_front'=>FALSE)