single-custom_type.php 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /*
  3. * CUSTOM POST TYPE TEMPLATE
  4. *
  5. * This is the custom post type post template. If you edit the post type name, you've got
  6. * to change the name of this template to reflect that name change.
  7. *
  8. * For Example, if your custom post type is "register_post_type( 'bookmarks')",
  9. * then your single template should be single-bookmarks.php
  10. *
  11. * For more info: http://codex.wordpress.org/Post_Type_Templates
  12. */
  13. ?>
  14. <?php get_header(); ?>
  15. <div id="content">
  16. <div id="inner-content" class="wrap cf">
  17. <div id="main" class="m-all t-2of3 d-5of7 cf" role="main">
  18. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  19. <article id="post-<?php the_ID(); ?>" <?php post_class('cf'); ?> role="article">
  20. <header class="article-header">
  21. <h1 class="single-title custom-post-type-title"><?php the_title(); ?></h1>
  22. <p class="byline vcard"><?php
  23. printf( __( 'Posted <time class="updated" datetime="%1$s" pubdate>%2$s</time> by <span class="author">%3$s</span> <span class="amp">&</span> filed under %4$s.', 'bonestheme' ), get_the_time( 'Y-m-j' ), get_the_time( __( 'F jS, Y', 'bonestheme' ) ), get_author_posts_url( get_the_author_meta( 'ID' ) ), get_the_term_list( $post->ID, 'custom_cat', ' ', ', ', '' ) );
  24. ?></p>
  25. </header> <!-- end article header -->
  26. <section class="entry-content cf">
  27. <?php
  28. // the content (pretty self explanatory huh)
  29. the_content();
  30. /*
  31. * Link Pages is used in case you have posts that are set to break into
  32. * multiple pages. You can remove this if you don't plan on doing that.
  33. *
  34. * Also, breaking content up into multiple pages is a horrible experience,
  35. * so don't do it. While there are SOME edge cases where this is useful, it's
  36. * mostly used for people to get more ad views. It's up to you but if you want
  37. * to do it, you're wrong and I hate you. (Ok, I still love you but just not as much)
  38. *
  39. * http://gizmodo.com/5841121/google-wants-to-help-you-avoid-stupid-annoying-multiple-page-articles
  40. *
  41. */
  42. wp_link_pages( array(
  43. 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'bonestheme' ) . '</span>',
  44. 'after' => '</div>',
  45. 'link_before' => '<span>',
  46. 'link_after' => '</span>',
  47. ) );
  48. ?>
  49. </section> <!-- end article section -->
  50. <footer class="article-header">
  51. <p class="tags"><?php echo get_the_term_list( get_the_ID(), 'custom_tag', '<span class="tags-title">' . __( 'Custom Tags:', 'bonestheme' ) . '</span> ', ', ' ) ?></p>
  52. </footer> <!-- end article footer -->
  53. <?php comments_template(); ?>
  54. </article> <!-- end article -->
  55. <?php endwhile; ?>
  56. <?php else : ?>
  57. <article id="post-not-found" class="hentry cf">
  58. <header class="article-header">
  59. <h1><?php _e( 'Oops, Post Not Found!', 'bonestheme' ); ?></h1>
  60. </header>
  61. <section class="entry-content">
  62. <p><?php _e( 'Uh Oh. Something is missing. Try double checking things.', 'bonestheme' ); ?></p>
  63. </section>
  64. <footer class="article-footer">
  65. <p><?php _e( 'This is the error message in the single-custom_type.php template.', 'bonestheme' ); ?></p>
  66. </footer>
  67. </article>
  68. <?php endif; ?>
  69. </div> <!-- end #main -->
  70. <?php get_sidebar(); ?>
  71. </div> <!-- end #inner-content -->
  72. </div> <!-- end #content -->
  73. <?php get_footer(); ?>