Advertisement
Guest User

WordPress custom post types - single.php

a guest
Jan 6th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.88 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package WordPress
  4.  * @subpackage Toolbox
  5.  */
  6.  
  7. get_header(); ?>
  8.  
  9.         <div id="primary">
  10.             <div id="content" role="main">
  11.  
  12.             <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  13.  
  14.                 <nav id="nav-above">
  15.                     <h1 class="section-heading"><?php _e( 'Post navigation', 'toolbox' ); ?></h1>
  16.                     <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'toolbox' ) . '</span> %title' ); ?></div>
  17.                     <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'toolbox' ) . '</span>' ); ?></div>
  18.                 </nav><!-- #nav-above -->
  19.  
  20.                 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  21.                     <header class="entry-header">
  22.                         <h1 class="entry-title"><?php the_title(); ?></h1>
  23.  
  24.                         <div class="entry-meta">
  25.                             <?php
  26.                                 printf( __( '<span class="sep">Posted on </span><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s">%6$s</a></span>', 'toolbox' ),
  27.                                     get_permalink(),
  28.                                     get_the_date( 'c' ),
  29.                                     get_the_date(),
  30.                                     get_author_posts_url( get_the_author_meta( 'ID' ) ),
  31.                                     sprintf( esc_attr__( 'View all posts by %s', 'toolbox' ), get_the_author() ),
  32.                                     get_the_author()
  33.                                 );
  34.                             ?>
  35.                         </div><!-- .entry-meta -->
  36.                     </header><!-- .entry-header -->
  37.  
  38.                     <div class="entry-content">
  39.                         <?php the_content(); ?>
  40.                        
  41.                         <!-- OUTPUT STATION INFORMATION -->
  42.                         <h3>Station Information</h3>
  43.                         <?php //if ( get_post_meta($post->ID, '_stationurl', true) ) : ?>
  44.                        
  45.                         <h4>Call Sign</h4>
  46.                             <?php echo get_post_meta($post->ID, "_callsign", true); ?>
  47.                        
  48.                         <h4>Website</h4>
  49.                             <?php echo get_post_meta($post->ID, "_stationurl", true); ?>
  50.                        
  51.                         <?php //endif; ?>
  52.                        
  53.                         <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'toolbox' ), 'after' => '</div>' ) ); ?>
  54.                     </div><!-- .entry-content -->
  55.  
  56.                     <footer class="entry-meta">
  57.                         <?php
  58.                             $tag_list = get_the_tag_list( '', ', ' );
  59.                             if ( '' != $tag_list ) {
  60.                                 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'toolbox' );
  61.                             } else {
  62.                                 $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'toolbox' );
  63.                             }
  64.                             printf(
  65.                                 $utility_text,
  66.                                 get_the_category_list( ', ' ),
  67.                                 $tag_list,
  68.                                 get_permalink(),
  69.                                 the_title_attribute( 'echo=0' )
  70.                             );
  71.                         ?>
  72.  
  73.                         <?php //edit_post_link( __( 'Edit', 'toolbox' ), '<span class="edit-link">', '</span>' ); ?>
  74.                     </footer><!-- .entry-meta -->
  75.                 </article><!-- #post-<?php the_ID(); ?> -->
  76.  
  77.                 <nav id="nav-below">
  78.                     <h1 class="section-heading"><?php _e( 'Post navigation', 'toolbox' ); ?></h1>
  79.                     <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'toolbox' ) . '</span> %title' ); ?></div>
  80.                     <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'toolbox' ) . '</span>' ); ?></div>
  81.                 </nav><!-- #nav-below -->
  82.  
  83.                 <?php comments_template( '', true ); ?>
  84.  
  85.             <?php endwhile; // end of the loop. ?>
  86.  
  87.             </div><!-- #content -->
  88.         </div><!-- #primary -->
  89.  
  90. <?php get_sidebar(); ?>
  91. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement