single-custom_type.php 3.6 KB

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