(Moderator's Note: The original title was "viewing custom post types")
I've setup a custom post type called 'recordings' with a custom taxonomy called '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
));
I've read that I should now make a copy of page.php, rename it recordings-page.php and season to taste (code is as follows):
<?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 -->
But this is where I'm stuck. I'm not sure how I should call my recordings-page? I've added a new page called recordings, but all that shows up is the header/nav and the sidebar. I'm working with a fresh install using the TwenyTen theme. I'm sure I'm missing something here but I don't know what.
