Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.45 KB | None | 0 0
  1. <?php
  2. /**
  3. * The Template for displaying all single blog posts
  4. *
  5. * @package SimpleMag
  6. * @since SimpleMag 1.0
  7. **/
  8. get_header();
  9. global $ti_option;
  10. $single_sidebar = get_post_meta( $post->ID, 'post_sidebar', true );
  11. ?>
  12.  
  13. <main id="content" class="clearfix animated" role="main" itemprop="mainContentOfPage" itemscope itemtype="http://schema.org/Blog">
  14.  
  15. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  16.  
  17. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope itemtype="http://schema.org/Article">
  18.  
  19. <header class="wrapper entry-header page-header">
  20. <div class="entry-meta">
  21. <?php if( $ti_option['single_author_name'] == 1 ) { ?>
  22. <span class="vcard author" itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person">
  23. <span><?php _e( 'By','themetext' ); ?></span>
  24. <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" class="url fn n" rel="author" itemprop="url">
  25. <span itemprop="name"><?php the_author_meta( 'display_name' ); ?></span>
  26. </a>
  27. </span>
  28. <?php } ?>
  29. <?php ti_meta_data(); ?>
  30. </div>
  31.  
  32. <div class="title-with-sep single-title">
  33. <h1 class="entry-title" itemprop="headline"><?php the_title(); ?></h1>
  34. </div>
  35. </header>
  36.  
  37. <?php
  38. // Output media only on first page if the post have pagination
  39. if ( $paged == 1 || $page == 1 ) {
  40. // Output media from every post by Full Width option
  41. if ( $ti_option['single_media_position'] == 'useperpost' && get_post_meta( $post->ID, 'post_media_position', true ) == 'media_full_width' || $ti_option['single_media_position'] == 'fullwidth' ){
  42. ?>
  43. <div class="entry-media">
  44. <?php
  45. if ( ! get_post_format() ): // Standard
  46. get_template_part( 'formats/format', 'standard' );
  47. elseif ( 'gallery' == get_post_format() ): // Gallery
  48. get_template_part( 'formats/format', 'gallery' );
  49. elseif ( 'video' == get_post_format() ): // Video
  50. get_template_part( 'formats/format', 'video' );
  51. elseif ( 'audio' == get_post_format() ): // Audio
  52. get_template_part( 'formats/format', 'audio' );
  53. endif;
  54. ?>
  55. </div>
  56. <?php } else { ?>
  57. <?php if ( 'gallery' == get_post_format() ) { ?>
  58. <div class="entry-media">
  59. <?php get_template_part( 'formats/format', 'gallery' ); ?>
  60. </div>
  61. <?php } ?>
  62. <?php } } ?>
  63.  
  64.  
  65. <div class="wrapper">
  66.  
  67. <?php if ( ! $single_sidebar || $single_sidebar == "post_sidebar_on" ) { // Enable/Disable post sidebar ?>
  68. <div class="grids">
  69. <div class="grid-8 column-1">
  70. <?php } ?>
  71.  
  72. <?php
  73. // Output media only on first page if the post have pagination
  74. if ( $paged == 1 || $page == 1 ) {
  75. // Output media from every post by Above The Content option
  76. if ( $ti_option['single_media_position'] == 'useperpost' && get_post_meta( $post->ID, 'post_media_position', true ) == 'media_above_content' || $ti_option['single_media_position'] == 'abovecontent' ) {
  77. ?>
  78. <div class="entry-media">
  79. <?php
  80. if ( ! get_post_format() ): // Standard
  81. get_template_part( 'formats/format', 'standard' );
  82. elseif ( 'video' == get_post_format() ): // Video
  83. get_template_part( 'formats/format', 'video' );
  84. elseif ( 'audio' == get_post_format() ): // Audio
  85. get_template_part( 'formats/format', 'audio' );
  86. endif;
  87. ?>
  88. </div>
  89. <?php } } ?>
  90.  
  91. <?php
  92. // Ad Unit
  93. if ( $ti_option['single_image_top_ad']['url'] == true || ! empty ( $ti_option['single_code_top_ad'] ) ) { ?>
  94. <div class="advertisement">
  95. <?php
  96. $single_banner_top = $ti_option['single_image_top_ad'];
  97. // Image Ad
  98. if ( $single_banner_top['url'] == true ) { ?>
  99. <a href="<?php echo $ti_option['single_image_top_ad_url']; ?>" rel="nofollow" target="_blank">
  100. <img src="<?php echo $single_banner_top['url']; ?>" width="<?php echo $single_banner_top['width']; ?>" height="<?php echo $single_banner_top['height']; ?>" alt="<?php _e( 'Advertisement', 'themetext' ); ?>" />
  101. </a>
  102. <?php
  103. // Code Ad
  104. } elseif( $ti_option['single_code_top_ad'] == true ) {
  105. echo $ti_option['single_code_top_ad'];
  106. } ?>
  107. </div><!-- .advertisment -->
  108. <?php } ?>
  109.  
  110. <?php
  111. // Post Rating
  112. if ( $ti_option['single_rating_box'] == 'rating_top' ) {
  113. get_template_part( 'inc/single', 'rating' );
  114. }
  115. ?>
  116.  
  117. <div class="single-box clearfix entry-content" itemprop="articleBody">
  118. <?php the_content(); ?>
  119. <?php
  120. $args = array(
  121. 'before' => '<div class="link-pages"><h3 class="title">' . __( 'Continue Reading', 'themetext' ) . '</h3>',
  122. 'after' => '</div>',
  123. 'link_before' => '<span>',
  124. 'link_after' => '</span>',
  125. 'nextpagelink' => '&rarr;',
  126. 'previouspagelink' => '&larr;',
  127. 'next_or_number' => 'next_and_number',
  128. );
  129. wp_link_pages( $args );
  130. ?>
  131. </div><!-- .entry-content -->
  132.  
  133. <?php
  134. // Post Rating output at the bottom
  135. if ( $ti_option['single_rating_box'] == 'rating_bottom' ) {
  136. get_template_part( 'inc/single', 'rating' );
  137. }
  138.  
  139. // Show/Hide tags list
  140. if ( $ti_option['single_tags_list'] == 1 ) {
  141. the_tags('<div class="single-box tag-box clearfix"><h3 class="title">' . __( 'Tags', 'themetext' ) . '</h3>', '', '</div>');
  142. }
  143.  
  144. // Show/Hide share links
  145. if ( $ti_option['single_social'] == 1 ) {
  146. get_template_part( 'inc/single', 'share' );
  147. }
  148.  
  149. // Show/Hide author box
  150. if ( $ti_option['single_author'] == 1 ) {
  151. get_template_part( 'inc/author', 'box' );
  152. }
  153. ?>
  154.  
  155. <?php
  156. // Ad Unit
  157. if ( $ti_option['single_image_bottom_ad']['url'] == true || ! empty ( $ti_option['single_code_bottom_ad'] ) ) { ?>
  158. <div class="single-box advertisement">
  159. <?php
  160. // Image Ad
  161. if ( $ti_option['single_image_bottom_ad']['url'] == true ) {
  162. $single_banner_botom = $ti_option['single_image_bottom_ad']; ?>
  163. <a href="<?php echo $ti_option['single_image_bottom_ad_url']; ?>" rel="nofollow" target="_blank">
  164. <img src="<?php echo $single_banner_botom['url']; ?>" width="<?php echo $single_banner_botom['width']; ?>" height="<?php echo $single_banner_botom['height']; ?>" alt="<?php _e( 'Advertisement', 'themetext' ); ?>" />
  165. </a>
  166. <?php
  167. }
  168. // Code Ad
  169. elseif ( $ti_option['single_code_bottom_ad'] == true ) {
  170. echo $ti_option['single_code_bottom_ad'];
  171. } ?>
  172. </div><!-- .advertisment -->
  173. <?php } ?>
  174.  
  175.  
  176. <?php
  177. // Navigation
  178. if ( $ti_option['single_nav_arrows'] == 1 ) { // Show/Hide Previous Post / Next Post Navigation
  179. $prev_post = get_previous_post();
  180. $next_post = get_next_post();
  181. ?>
  182. <nav class="single-box clearfix nav-single">
  183. <?php if ( !empty( $prev_post ) ) { ?>
  184. <div class="nav-previous">
  185. <?php previous_post_link ( '%link', '<i class="icomoon-chevron-left"></i><span class="sub-title">' . __( 'Previous article', 'themetext' ) . '</span>%title', TRUE ); ?>
  186. </div>
  187. <?php } ?>
  188.  
  189. <?php if ( !empty( $next_post ) && !empty( $prev_post ) ) { ?>
  190. <span class="sep"></span>
  191. <?php } ?>
  192.  
  193. <?php if ( !empty( $next_post ) ){ ?>
  194. <div class="nav-next">
  195. <?php next_post_link( '%link', '<i class="icomoon-chevron-right"></i><span class="sub-title">' . __( 'Next article', 'themetext' ) . '</span>%title', TRUE ); ?>
  196. </div>
  197. <?php } ?>
  198. </nav><!-- .nav-single -->
  199. <?php } ?>
  200.  
  201.  
  202. <?php
  203. // Show/Hide related posts
  204. if ( $ti_option['single_related'] == 1 ) {
  205. get_template_part( 'inc/related', 'posts' );
  206. }
  207. ?>
  208.  
  209. <?php comments_template(); // Comments Template ?>
  210.  
  211.  
  212. <?php if ( ! $single_sidebar || $single_sidebar == "post_sidebar_on" ) { // Enable/Disable post sidebar ?>
  213. </div><!-- .grid-8 -->
  214.  
  215. <?php get_sidebar(); ?>
  216. </div><!-- .grids -->
  217. <?php } ?>
  218.  
  219. </div><!-- .wrapper -->
  220.  
  221. </article>
  222.  
  223. <?php endwhile; endif; ?>
  224.  
  225. </main><!-- #content -->
  226.  
  227. <?php
  228. // Show/Hide random posts slide dock
  229. if ( $ti_option['single_slide_dock'] == 1 ) {
  230. get_template_part( 'inc/slide', 'dock' );
  231. }
  232. ?>
  233.  
  234. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement