标签的id而不是链接中的名称,wordpress

时间:2014-07-30 18:48:14

标签: wordpress permalinks taxonomy

我使用分类法制作数据库。所有带有标记名称的链接。是否可以使标签在链接中使用其ID?

在function.php中我用这个

register_taxonomy( 'game', 'post', array( 'hierarchical' => false, 'label' => __('Game', 'series'), 'query_var' => 'game', 'rewrite' => array( 'slug' => 'Games' ) ) );

页面

<?php echo get_the_term_list( $post->ID, 'game', 'Games: ', ', ', '' ); ?>

现在链接看起来像 HTTP:// * 的.com /游戏/冲突-的部族/

我需要他们看起来像 HTTP:// * 的.com /游戏/ 123 /

1 个答案:

答案 0 :(得分:0)

在永久链接设置中使用数字结构。请参阅Using Permalinks

或者,您可以使用Custom Structure并在字段中使用%category%/%post_id%