Advertisement
Uranbold

single.php

Mar 24th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.49 KB | None | 0 0
  1. <?php
  2. the_post();
  3. get_header();
  4. ever_seen_add();
  5.  
  6. global $ever_options;
  7.  
  8. $layout = ever_metabox('single_layout');
  9. if(empty($layout)){
  10. $layout = ever_option('single_layout', 'right-sidebar');
  11. }
  12.  
  13. $width = ' col-md-8';
  14. if($layout == 'fullwidth-content'){
  15. $width = ' col-md-12';
  16. }
  17. $format = get_post_format() == "" ? "standard" : get_post_format();
  18.  
  19. $single_ads = ever_option('ads-single');
  20. if(!empty($single_ads)){
  21. echo '<div class="tw-ads ads-single-top">';
  22. echo do_shortcode($single_ads);
  23. echo '</div>';
  24. }
  25. if($ever_options['single_media'] == 'large'){
  26. $atts['img_size'] = 'ever_blog_large';
  27. $img = ever_entry_media($format, $atts);
  28. echo '<div class="single-content single-large-media'.(!empty($img) ? ' with-media': '').'">';
  29. ever_single_title();
  30. //ever_single_share();
  31. echo ($img);
  32. echo '</div>';
  33. }
  34. ?>
  35. <div class="row">
  36. <?php if($layout == 'left-sidebar'){ get_sidebar(); }?>
  37. <div class="content-area <?php echo esc_attr($layout.$width);?>">
  38. <div class="single-content">
  39. <article <?php post_class('single'); ?>>
  40. <?php
  41. if($ever_options['single_media'] == 'small'){
  42. ever_single_title();
  43. //ever_single_share();
  44. $atts['img_size'] = 'ever_single_post';
  45. echo ever_entry_media($format, $atts);
  46. }
  47. ?>
  48. <div class="single-padding">
  49. <?php
  50. if($ever_options['single_media'] == 'fullwidth'){
  51. //ever_single_share();
  52. }
  53. ?>
  54. <div class="entry-content">
  55. <?php the_content(); ?>
  56. <?php wp_link_pages(); ?>
  57. <div class="clearfix"></div>
  58. </div>
  59. <?php
  60. if(ever_option('single_tags', true)){
  61. echo get_the_tag_list('<div class="entry-tags tw-meta">', '', '</div>');
  62. }
  63. ever_single_share();
  64. ?>
  65. </div>
  66. </article>
  67. <div class="single-padding">
  68. <?php
  69. if(ever_option('single_pagination', true)){
  70. $prev = get_adjacent_post(false,'',true) ;
  71. $next = get_adjacent_post(false,'',false) ; ?>
  72. <div class="nextprev-postlink-container">
  73. <div class="nextprev-postlink clearfix">
  74. <?php if ( isset($prev->ID) ):
  75. $pid = $prev->ID;
  76. $img = wp_get_attachment_image_src( get_post_thumbnail_id($pid), 'ever_grid_thumb' );
  77. $thumb = $class = '';
  78. if($img['0']){
  79. $thumb = ' style="background-image: url('.esc_url($img['0']).')"';
  80. $class = ' with-img';
  81. } ?>
  82. <div class="prev-post-link<?php echo esc_attr($class); ?>">
  83. <?php
  84. if(!empty($thumb)){
  85. echo '<a href="'. esc_url(get_permalink( $pid )) .'" title="'. get_the_title( $pid ) .'" class="post-thumb"'. $thumb .'></a>';
  86. }
  87. ?>
  88. <a href="<?php echo esc_url(get_permalink( $pid )); ?>" title="<?php echo get_the_title( $pid );?>"><?php echo ('<span class="tw-meta">'.esc_html__('Previous', 'ever').'</span><h4>'.get_the_title( $pid ).'</h4><span class="tw-meta">'.get_the_time(get_option('date_format'), $pid).'</span>'); ?></a>
  89. </div>
  90. <?php endif;
  91. if ( isset($next->ID) ):
  92. $pid = $next->ID;
  93. $img = wp_get_attachment_image_src( get_post_thumbnail_id($pid), 'ever_grid_thumb' );
  94. $thumb = $class = '';
  95. if($img['0']){
  96. $thumb = ' style="background-image: url('.esc_url($img['0']).')"';
  97. $class = ' with-img';
  98. }?>
  99. <div class="next-post-link<?php echo esc_attr($class); ?>">
  100. <?php
  101. if(!empty($thumb)){
  102. echo '<a href="'. esc_url(get_permalink( $pid )) .'" title="'. get_the_title( $pid ) .'" class="post-thumb"'. $thumb .'></a>';
  103. }
  104. ?>
  105. <a href="<?php echo esc_url(get_permalink( $pid )); ?>"><?php echo ('<span class="tw-meta">'.esc_html__('Next', 'ever').'</span><h4>'.get_the_title( $pid ).'</h4><span class="tw-meta">'.get_the_time(get_option('date_format'), $pid).'</span>'); ?></a>
  106. </div>
  107. <?php endif; ?>
  108. </div>
  109. </div>
  110. <?php }
  111. if(ever_option('single_author', true)){
  112. ever_author();
  113. }
  114. comments_template('', true); ?>
  115. </div>
  116. </div>
  117. </div>
  118. <?php if($layout == 'right-sidebar'){ get_sidebar(); }?>
  119. </div>
  120. <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement