Advertisement
nlozovan

Untitled

Jun 30th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.38 KB | None | 0 0
  1. <?php
  2. global $current_gallery;
  3.  
  4. if ( post_password_required() ) {
  5. $is_password_protected = true;
  6. }else{
  7. $is_password_protected = false;
  8. }
  9. wp_localize_script( 'functions', 'enb_Galleria', array(
  10. 'gallery_enb' => true,
  11. 'password_protected' => $is_password_protected
  12. )
  13. );
  14.  
  15.  
  16. if(isset($current_gallery)){ /*this is available when a gallery is used in a template, for exanple when you want to show on hte front page a gallery*/
  17. global $wp_query;
  18.  
  19. $wp_query = new WP_Query( array('p' => $current_gallery, 'post_type' => 'gallery' ) );
  20.  
  21. $post_id = $post -> ID;
  22. }
  23. while( have_posts() ){
  24. the_post();
  25. ?>
  26.  
  27. <?php
  28. } /*EOF while( have_posts () ) */
  29. ?>
  30. <?php
  31. /*if the gallery is mosaic*/
  32. if ( get_posts_gallery_type($post -> ID) == 'mosaic' || get_posts_gallery_type($post -> ID) == 'vertical-scroll') { ?>
  33. <div class="row" >
  34. <div class="twelve columns">
  35.  
  36. <?php if(options::logic( 'likes' , 'enb_likes' ) ){ ?>
  37. <div class="single-like-container">
  38. <?php like::content($post->ID,$return = false, $show_icon = true, $show_label = false); ?>
  39. </div>
  40. <?php } ?>
  41.  
  42. <h1 class="post-title">
  43. <?php the_title(); ?>
  44. </h1>
  45.  
  46. <?php
  47. if(get_post_type($post -> ID) == 'post'){
  48. $cat_tax = 'category';
  49. } elseif(get_post_type( $post -> ID) == 'gallery') {
  50. $cat_tax = 'gallery-category';
  51. } elseif(get_post_type( $post -> ID) == 'page') {
  52. $cat_tax = '';
  53. }
  54. $the_categories = post::get_post_categories($post->ID, $only_first_cat = false, $taxonomy = $cat_tax, $margin_elem_start = ' <li>', $margin_elem_end = '</li>', $delimiter = '');
  55. ?>
  56.  
  57. <?php
  58.  
  59. echo ' <div class="meta-details">';
  60. include_once('entry-meta.php');
  61. echo '</div>';
  62. ?>
  63.  
  64.  
  65.  
  66. <?php if (!$is_password_protected) { ?>
  67. <div class="content">
  68. <?php the_content(); ?>
  69. </div>
  70. </div>
  71. </div>
  72.  
  73. <?php }
  74.  
  75.  
  76. } ?>
  77.  
  78. <?php
  79. $infostatus = '';
  80. if((options::logic( 'blog_post' , 'hide_gallery_info' ) && meta::logic( $post , 'gallerytype' , 'hide_gallery_info' )) ||
  81. meta::logic( $post , 'gallerytype' , 'hide_gallery_info' )) {
  82. $infostatus = 'no-gallery-sidebar';
  83.  
  84. };
  85.  
  86. if ( 1 == meta::logic( $post , 'gallerytype' , 'show_collapse_btn' )){
  87. $infostatus .=' show-collapse';
  88. $collapse = 1;
  89. }
  90.  
  91. ?>
  92. <div class="<?php echo $infostatus; if( get_posts_gallery_type($post -> ID) == 'vertical-scroll' ){echo "vertical-scroll row";} ?>">
  93.  
  94. <?php if( !post_password_required() && get_posts_gallery_type($post -> ID) != 'mosaic' && get_posts_gallery_type($post -> ID) != 'vertical-scroll'){
  95.  
  96. if ( !options::logic( 'blog_post' , 'hide_gallery_info' ) && !meta::logic( $post , 'gallerytype' , 'hide_gallery_info' ) || (1 == meta::logic( $post , 'gallerytype' , 'show_collapse_btn' ) ) ) {
  97.  
  98. ?>
  99. <div class="gallery-info">
  100. <h1 class="post-title">
  101. <?php the_title();?>
  102. </h1>
  103.  
  104. <?php if(options::logic( 'likes' , 'enb_likes' )){ ?>
  105. <div class="single-like-container">
  106. <?php like::content($post->ID,$return = false, $show_icon = true, $show_label = false); ?>
  107. </div>
  108. <?php } ?>
  109.  
  110. <?php
  111. if(get_post_type($post -> ID) == 'post'){
  112. $cat_tax = 'category';
  113. } elseif(get_post_type( $post -> ID) == 'gallery') {
  114. $cat_tax = 'gallery-category';
  115. } elseif(get_post_type( $post -> ID) == 'page') {
  116. $cat_tax = '';
  117. }
  118. $the_categories = post::get_post_categories($post->ID, $only_first_cat = false, $taxonomy = $cat_tax, $margin_elem_start = ' <li>', $margin_elem_end = '</li>', $delimiter = '');
  119. ?>
  120. <?php
  121. echo '<div class="meta-details">';
  122. include_once('entry-meta.php');
  123. echo '</div>';
  124. ?>
  125.  
  126. <div class="content">
  127. <?php the_content(); ?>
  128. </div>
  129.  
  130. <?php if(options::logic( 'blog_post' , 'show_next_prev' )){ ?>
  131. <nav class="hotkeys-meta">
  132. <?php $portfolio_first_categ = post::get_post_categories($post->ID, $only_first_cat = true, $taxonomy = 'gallery-category', $margin_elem_start = '', $margin_elem_end = '', $delimiter = '', $a_class = 'icon-root', $show_cat_name = false);
  133. ?>
  134. <?php
  135. $ppost = get_previous_post();
  136. $npost = get_next_post();
  137. if( !empty( $ppost ) ){
  138. echo '<span><a class="icon-prev" href="' . get_permalink( $ppost -> ID ) . '" title="'.$ppost -> post_title.'"></a></span>';
  139. }
  140. if(strlen(trim($portfolio_first_categ) )){
  141. echo '<span>'.$portfolio_first_categ.'</span>';
  142. }
  143.  
  144. if( !empty( $npost ) ){
  145. echo '<span><a class="icon-next" href="' . get_permalink( $npost -> ID ) . '" title="'.$npost -> post_title.'"></a></span>';
  146. }
  147. ?>
  148.  
  149. </nav>
  150. <?php } ?>
  151. </div>
  152. <?php if(options::logic( 'blog_post' , 'show_collapse_btn' ) && 1 == meta::logic( $post , 'gallerytype' , 'show_collapse_btn' ) ){ ?>
  153. <?php if (!options::logic( 'blog_post' , 'hide_gallery_info' ) && !meta::logic( $post , 'gallerytype' , 'hide_gallery_info' )){ ?>
  154. <div class="collapse-btn">
  155. <i class="icon-prev "></i>
  156. <span><?php _e('Click to collapse', 'cosmotheme'); ?></span>
  157. <?php } else { ?>
  158. <div class="collapse-btn collapsed">
  159. <i class="icon-next "></i>
  160. <span><?php _e('Click to display', 'cosmotheme'); ?></span>
  161. <?php } ?>
  162. </div>
  163. <?php }
  164. }
  165. }
  166. ?>
  167.  
  168. <?php
  169. if ( !post_password_required() ) {
  170. if( get_posts_gallery_type($post -> ID) == 'sly'){
  171. echo post::get_post_img_slideshow( $post -> ID, 'single_gallery' );
  172. }else if( get_posts_gallery_type($post -> ID) == 'image_flow' ){
  173. echo post::get_post_img_flow_slide($post -> ID, $size="single_gallery");
  174. }else if( get_posts_gallery_type($post -> ID) == 'mosaic' ){
  175. echo post::get_post_img_mosaic($post -> ID);
  176. }else if( get_posts_gallery_type($post -> ID) == 'vertical-scroll' ){
  177. echo post::get_post_img_vertical_scroll( $post -> ID, 'single_gallery' );
  178. }else{
  179. echo post::get_post_gallery_slide($post -> ID, $size="single_gallery");
  180. }
  181. }else{
  182. ?>
  183. <div class="entry-header row">
  184. <div class="password-center three columns">
  185. <i class="icon-password"></i>
  186. </div>
  187. <div class="nine columns">
  188. <h1 class="post-title">
  189. <?php the_title(); ?>
  190. </h1>
  191.  
  192. <?php if(options::logic( 'likes' , 'enb_likes' )){ ?>
  193. <div class="single-like-container">
  194. <?php like::content($post->ID,$return = false, $show_icon = true, $show_label = false); ?>
  195. </div>
  196. <?php } ?>
  197.  
  198. <?php
  199. if(get_post_type($post -> ID) == 'post'){
  200. $cat_tax = 'category';
  201. } elseif(get_post_type( $post -> ID) == 'gallery') {
  202. $cat_tax = 'gallery-category';
  203. } elseif(get_post_type( $post -> ID) == 'page') {
  204. $cat_tax = '';
  205. }
  206. $the_categories = post::get_post_categories($post->ID, $only_first_cat = false, $taxonomy = $cat_tax, $margin_elem_start = ' <li>', $margin_elem_end = '</li>', $delimiter = '');
  207. ?>
  208. <?php
  209. echo '<div class="meta-details">';
  210. include_once('entry-meta.php');
  211. echo '</div>';
  212. ?>
  213. <div class="content">
  214. <?php the_content(); ?>
  215. </div>
  216.  
  217. <?php if(options::logic( 'blog_post' , 'show_next_prev' )){ ?>
  218. <nav class="hotkeys-meta">
  219. <?php $portfolio_first_categ = post::get_post_categories($post->ID, $only_first_cat = true, $taxonomy = 'gallery-category', $margin_elem_start = '', $margin_elem_end = '', $delimiter = '', $a_class = 'icon-root', $show_cat_name = false);
  220. ?>
  221. <?php
  222. $ppost = get_previous_post();
  223. $npost = get_next_post();
  224. if( !empty( $ppost ) ){
  225. echo '<span><a class="icon-prev" href="' . get_permalink( $ppost -> ID ) . '" title="'.$ppost -> post_title.'"></a></span>';
  226. }
  227. if(strlen(trim($portfolio_first_categ) )){
  228. echo '<span>'.$portfolio_first_categ.'</span>';
  229. }
  230.  
  231. if( !empty( $npost ) ){
  232. echo '<span><a class="icon-next" href="' . get_permalink( $npost -> ID ) . '" title="'.$npost -> post_title.'"></a></span>';
  233. }
  234. ?>
  235.  
  236. </nav>
  237. <?php } ?>
  238. </div>
  239. </div>
  240.  
  241.  
  242.  
  243. <?php
  244. }
  245. ?>
  246.  
  247. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement