(Moderator\'s Note: 最初的标题是“查看自定义帖子类型”)
我已经设置了一个名为\'recordings\'
使用名为\'themes\'
:
add_action(\'init\', \'recordings\');
function recordings() {
$args = array(
\'label\' => __(\'Recordings\'),
\'singular_label\' => __(\'Recordings\'),
\'public\' => true,
\'show_ui\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'rewrite\' => true,
\'supports\' => array(\'title\', \'editor\', \'thumbnail\', \'custom-fields\')
);
register_post_type( \'recordings\' , $args );
}
register_taxonomy("Themes", array("recordings"), array(
"hierarchical" => true,
"label" => "Themes",
"singular_label" => "Theme",
"rewrite" => true
));
我读到我现在应该复印一份
page.php
, 重命名它
recordings-page.php
和品尝季节(代码如下):
<?php
/*
Template Name: recordingsPage
*/
?>
<?php get_header(); ?>
<div id="container">
<div id="content" role="main">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>
<?php $recent = new WP_Query(\'post_type=recording&posts_per_page=10&meta_key=Date&orderby=meta_value&order=ASC\'); ?>
<?php while($recent->have_posts()) : $recent->the_post();?>
<?php the_title( \'<h2 class="entry-title"><a href="\' .
get_permalink() . \'" title="\' . the_title_attribute( \'echo=0\' ) .
\'" rel="bookmark">\', \'</a></h2>\'
); ?>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array(
\'before\' => \'<div class="page-link">\' . __( \'Pages:\', \'twentyten\' ),
\'after\' => \'</div>\'
) ); ?>
<?php edit_post_link(
__( \'Edit\', \'twentyten\' ),
\'<span class="edit-link">\', \'</span>\'
); ?>
</div><!-- .entry-content -->
<?php comments_template( \'\', true ); ?>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #container -->
但这就是我被困的地方。我不知道该怎么称呼我的录音页面?我添加了一个名为recordings的新页面,但只显示了标题/导航和侧栏。我正在使用TwenyTen主题进行新的安装。我肯定我错过了什么,但我不知道是什么。