Advertisement
Janeane

Josh's New Problem

Apr 14th, 2016
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. * The Child Theme template for displaying all single posts.
  2. *
  3. */
  4.  
  5. <?php get_header(); ?>
  6.  
  7. <div class="wrapper section-inner">
  8.  
  9. <div class="content left">
  10.  
  11. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  12.  
  13. <div class="posts">
  14.  
  15. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  16.  
  17. <div class="post-header">
  18.  
  19. <?php if ( has_post_thumbnail() ) : ?>
  20.  
  21. <div class="featured-media">
  22.  
  23. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
  24.  
  25. <?php the_post_thumbnail('post-image'); ?>
  26.  
  27. <?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>
  28.  
  29. <div class="media-caption-container">
  30.  
  31. <p class="media-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>
  32.  
  33. </div>
  34.  
  35. <?php endif; ?>
  36.  
  37. </a>
  38.  
  39. </div> <!-- /featured-media -->
  40.  
  41. <?php endif; ?>
  42.  
  43. <?php $videourl = get_post_meta($post->ID, 'videourl', true); if ( $videourl != '' ) : ?>
  44.  
  45. <div class="featured-media">
  46.  
  47. <?php if (strpos($videourl,'.mp4') !== false) : ?>
  48.  
  49. <video controls>
  50. <source src="<?php echo $videourl; ?>" type="video/mp4">
  51. </video>
  52.  
  53. <?php else : ?>
  54.  
  55. <?php
  56.  
  57. $embed_code = wp_oembed_get($videourl);
  58.  
  59. echo $embed_code;
  60.  
  61. ?>
  62.  
  63. <?php endif; ?>
  64.  
  65. </div> <!-- /featured-media -->
  66.  
  67. <?php endif; ?>
  68.  
  69. <h1 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
  70.  
  71. <div class="post-meta">
  72.  
  73. <span class="post-date"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_time(get_option('date_format')); ?></a></span>
  74.  
  75. <span class="date-sep"> / </span>
  76.  
  77. <span class="post-author"><?php the_author_posts_link(); ?></span>
  78.  
  79. <span class="date-sep"> / </span>
  80.  
  81. <?php comments_popup_link( '<span class="comment">' . __( '0 Comments', 'hemingway' ) . '</span>', __( '1 Comment', 'hemingway' ), __( '% Comments', 'hemingway' ) ); ?>
  82.  
  83. <?php if ( current_user_can( 'manage_options' ) ) { ?>
  84.  
  85. <span class="date-sep"> / </span>
  86.  
  87. <?php edit_post_link(__('Edit', 'hemingway')); ?>
  88.  
  89. <?php } ?>
  90.  
  91. </div>
  92.  
  93. </div> <!-- /post-header -->
  94.  
  95. <div class="post-content">
  96.  
  97. <?php the_content(); ?>
  98.  
  99. <?php wp_link_pages(); ?>
  100.  
  101. </div> <!-- /post-content -->
  102.  
  103. <div class="clear"></div>
  104.  
  105. <div class="post-meta-bottom">
  106.  
  107. <p class="post-categories"><span class="category-icon"><span class="front-flap"></span></span> <?php the_category(', '); ?></p>
  108.  
  109. <?php if( has_tag()) { ?><p class="post-tags"><?php the_tags('', ''); ?></p><?php } ?>
  110.  
  111. <div class="clear"></div>
  112.  
  113. <div class="post-nav">
  114.  
  115. <?php
  116. $prev_post = get_previous_post();
  117. if (!empty( $prev_post )): ?>
  118.  
  119. <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 ); ?>">
  120.  
  121. <h5><?php _e('Previous post', 'hemingway'); ?></h5>
  122. <?php echo get_the_title($prev_post); ?>
  123.  
  124. </a>
  125.  
  126. <?php endif; ?>
  127.  
  128. <?php
  129. $next_post = get_next_post();
  130. if (!empty( $next_post )): ?>
  131.  
  132. <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 ); ?>">
  133.  
  134. <h5><?php _e('Next post', 'hemingway'); ?></h5>
  135. <?php echo get_the_title($next_post); ?>
  136.  
  137. </a>
  138.  
  139. <?php endif; ?>
  140.  
  141. <div class="clear"></div>
  142.  
  143. </div> <!-- /post-nav -->
  144.  
  145. </div> <!-- /post-meta-bottom -->
  146.  
  147. <?php comments_template( '', true ); ?>
  148.  
  149. <?php endwhile; else: ?>
  150.  
  151. <p><?php _e("We couldn't find any posts that matched your query. Please try again.", "hemingway"); ?></p>
  152.  
  153. <?php endif; ?>
  154.  
  155. </div> <!-- /post -->
  156.  
  157. </div> <!-- /posts -->
  158.  
  159. </div> <!-- /content -->
  160.  
  161. <?php get_sidebar(); ?>
  162.  
  163. <div class="clear"></div>
  164.  
  165. </div> <!-- /wrapper -->
  166.  
  167. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement