自定义帖子类型永久链接不适用于新帖子

时间:2014-03-16 08:11:35

标签: wordpress custom-post-type permalinks

我已经挣扎了一段时间,并且真的很感激任何帮助。

我有一个自定义帖子类型'场地'在我正在努力的网站上。我有永久链接设置,因此它们如下:http://www.site-name.com/venues/venue-name

这已经很好了直到现在。但每当我添加一个新的场地时,它上面的永久链接似乎都不起作用 - 它只是一个空白的白页。我不确定如何解决这个问题,因为它正在处理所有以前的场地条目。

以下是自定义帖子类型的相关代码:

function venues () {
$labels = array(
    'name'               => _x( 'Venues', 'post type general name' ),
    'singular_name'      => _x( 'Venue', 'post type singular name' ),
    'add_new'            => _x( 'Add New', 'venue' ),
    'add_new_item'       => __( 'Add New Venue' ),
    'edit_item'          => __( 'Edit Venue' ),
    'new_item'           => __( 'New Venue' ),
    'all_items'          => __( 'All Venues' ),
    'view_item'          => __( 'View Venues' ),
    'search_items'       => __( 'Search Venues' ),
    'not_found'          => __( 'No Venues found' ),
    'not_found_in_trash' => __( 'No Venues found in the Trash' ),
    'parent_item_colon'  => '',
    'menu_name'          => 'Venues'
);
$args = array(
    'labels'        => $labels,
                'taxonomies'            => array('category'),

    'description'   => 'This is where all of the venues in the Find Us section are held',
    'public'        => true,
    'menu_position' => 5,
    'supports'      => array( 'title', 'thumbnail'),
    'has_archive'   => true,
    'rewrite'                    => array('slug' => 'venue'),

);
register_post_type( 'venues', $args );

}

0 个答案:

没有答案