这应该相当简单,我不知道我做错了什么。我正在尝试显示与自定义帖子关联的标签。
我是这样注册的
// Initialize Taxonomy Labels
$labels = array(
\'name\' => _x( \'Tags\', \'taxonomy general name\' ),
\'singular_name\' => _x( \'Tag\', \'taxonomy singular name\' ),
\'search_items\' => __( \'Search Types\' ),
\'all_items\' => __( \'All Tags\' ),
\'parent_item\' => __( \'Parent Tag\' ),
\'parent_item_colon\' => __( \'Parent Tag:\' ),
\'edit_item\' => __( \'Edit Tags\' ),
\'update_item\' => __( \'Update Tag\' ),
\'add_new_item\' => __( \'Add New Tag\' ),
\'new_item_name\' => __( \'New Tag Name\' ),
);
// Register Custom Taxonomy
register_taxonomy(\'tagevents\',array(\'events\'), array(
\'hierarchical\' => true, // define whether to use a system like tags or categories
\'labels\' => $labels,
\'show_ui\' => true,
\'query_var\' => true,
\'rewrite\' => array( \'slug\' => \'tag-events\' ),
));
但我无法显示与单个页面关联的标记。
我试过(除其他外)<?php the_tags(\'<span class="tags-button">Tags : \',\' \',\'</span><br />\'); ?>
我在我的文章单页中使用它。