single.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?php get_header(); ?>
  2. <div class="wrapper section-inner">
  3. <div class="content left">
  4. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  5. <div class="posts">
  6. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  7. <div class="post-header">
  8. <?php if ( has_post_thumbnail() ) : ?>
  9. <div class="featured-media">
  10. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
  11. <?php the_post_thumbnail('post-image'); ?>
  12. <?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>
  13. <div class="media-caption-container">
  14. <p class="media-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>
  15. </div>
  16. <?php endif; ?>
  17. </a>
  18. </div> <!-- /featured-media -->
  19. <?php endif; ?>
  20. <?php $videourl = get_post_meta($post->ID, 'videourl', true); if ( $videourl != '' ) : ?>
  21. <div class="featured-media">
  22. <?php if (strpos($videourl,'.mp4') !== false) : ?>
  23. <video controls>
  24. <source src="<?php echo $videourl; ?>" type="video/mp4">
  25. </video>
  26. <?php else : ?>
  27. <?php
  28. $embed_code = wp_oembed_get($videourl);
  29. echo $embed_code;
  30. ?>
  31. <?php endif; ?>
  32. </div> <!-- /featured-media -->
  33. <?php endif; ?>
  34. <h1 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
  35. <div class="post-meta">
  36. <span class="post-date"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_time(get_option('date_format')); ?></a></span>
  37. <span class="date-sep"> / </span>
  38. <span class="post-author"><?php the_author_posts_link(); ?></span>
  39. <span class="date-sep"> / </span>
  40. <?php comments_popup_link( '<span class="comment">' . __( '0 Comments', 'hemingway' ) . '</span>', __( '1 Comment', 'hemingway' ), __( '% Comments', 'hemingway' ) ); ?>
  41. <?php if ( current_user_can( 'manage_options' ) ) { ?>
  42. <span class="date-sep"> / </span>
  43. <?php edit_post_link(__('Edit', 'hemingway')); ?>
  44. <?php } ?>
  45. </div>
  46. </div> <!-- /post-header -->
  47. <div class="post-content">
  48. <?php the_content(); ?>
  49. <?php wp_link_pages(); ?>
  50. </div> <!-- /post-content -->
  51. <div class="clear"></div>
  52. <div class="post-meta-bottom">
  53. <p class="post-categories"><span class="category-icon"><span class="front-flap"></span></span> <?php the_category(', '); ?></p>
  54. <?php if( has_tag()) { ?><p class="post-tags"><?php the_tags('', ''); ?></p><?php } ?>
  55. <div class="clear"></div>
  56. <div class="post-nav">
  57. <?php
  58. $prev_post = get_previous_post();
  59. if (!empty( $prev_post )): ?>
  60. <a class="post-nav-older" title="<?php _e('Previous post:', 'hemingway'); echo ' ' . get_the_title($prev_post); ?>" href="<?php echo get_permalink( $prev_post->ID ); ?>">
  61. <h5><?php _e('Previous post', 'hemingway'); ?></h5>
  62. <?php echo get_the_title($prev_post); ?>
  63. </a>
  64. <?php endif; ?>
  65. <?php
  66. $next_post = get_next_post();
  67. if (!empty( $next_post )): ?>
  68. <a class="post-nav-newer" title="<?php _e('Next post:', 'hemingway'); echo ' ' . get_the_title($next_post); ?>" href="<?php echo get_permalink( $next_post->ID ); ?>">
  69. <h5><?php _e('Next post', 'hemingway'); ?></h5>
  70. <?php echo get_the_title($next_post); ?>
  71. </a>
  72. <?php endif; ?>
  73. <div class="clear"></div>
  74. </div> <!-- /post-nav -->
  75. </div> <!-- /post-meta-bottom -->
  76. <?php comments_template( '', true ); ?>
  77. <?php endwhile; else: ?>
  78. <p><?php _e("We couldn't find any posts that matched your query. Please try again.", "hemingway"); ?></p>
  79. <?php endif; ?>
  80. </div> <!-- /post -->
  81. </div> <!-- /posts -->
  82. </div> <!-- /content -->
  83. <?php get_sidebar(); ?>
  84. <div class="clear"></div>
  85. </div> <!-- /wrapper -->
  86. <?php get_footer(); ?>