Advertisement
nlozovan

Untitled

Feb 21st, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.95 KB | None | 0 0
  1. <?php
  2. global $post;
  3. $post_id = $post -> ID;
  4.  
  5. $s = wp_get_attachment_image_src( get_post_thumbnail_id( $post -> ID ) , 'full' );
  6.  
  7. if(!options::logic( 'blog_post' , 'meta' ) || !meta::logic( $post , 'settings' , 'meta' )){
  8. $no_meta_class = ' no-meta ';
  9. }else{
  10. $no_meta_class = ' ';
  11. }
  12. ?>
  13. <article class="post single-post <?php echo $no_meta_class; ?>">
  14.  
  15.  
  16. <?php
  17. if(get_post_type($post -> ID) == 'post'){
  18. $cat_tax = 'category';
  19. } elseif(get_post_type( $post -> ID) == 'gallery') {
  20. $cat_tax = 'gallery-category';
  21. } elseif(get_post_type( $post -> ID) == 'testimonial') {
  22. $cat_tax = '';
  23. } elseif(get_post_type( $post -> ID) == 'page') {
  24. $cat_tax = '';
  25. }
  26. $the_categories = post::get_post_categories($post->ID, $only_first_cat = false, $taxonomy = $cat_tax, $margin_elem_start = ' <li>', $margin_elem_end = '</li>', $delimiter = '');
  27. ?>
  28.  
  29. <?php
  30.  
  31. if(options::logic( 'likes' , 'enb_likes' ) ){
  32. $meta = meta::get_meta( $post -> ID, 'settings' );
  33.  
  34. if ( $meta['love'] =='yes'){
  35.  
  36. ?>
  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 if((get_post_type() == 'page' && options::logic( 'blog_post' , 'page_meta' )) || (get_post_type() == 'post' && options::logic( 'blog_post' , 'meta' ))){
  47. if( meta::logic( $post , 'settings' , 'meta' ) ){
  48. echo ' <div class="meta-details">';
  49. include_once('entry-meta.php');
  50. echo '</div>';
  51. }
  52. } ?>
  53. <div class="excerpt">
  54. <?php
  55. if( get_post_format( $post -> ID ) == 'audio' ){
  56. echo do_shortcode( post::get_audio_file( $post -> ID ) );
  57. }
  58.  
  59. //-------------------------
  60. if( get_post_format( $post -> ID ) == 'video' ){
  61.  
  62. $video_format = meta::get_meta( $post -> ID , 'format' );
  63. ?>
  64.  
  65. <div class="embedded_videos">
  66.  
  67. <?php
  68.  
  69. if(isset($video_format['video_ids']) && !empty($video_format['video_ids'])){
  70. foreach($video_format["video_ids"] as $videoid)
  71. {
  72. if( isset( $video_format[ 'video_urls' ][ $videoid ] ) ){
  73. $video_url = $video_format[ 'video_urls' ][ $videoid ];
  74. if( post::get_youtube_video_id($video_url) != "0" ){
  75. echo post::get_embeded_video( post::get_youtube_video_id( $video_url ), "youtube" );
  76. }else if( post::get_vimeo_video_id( $video_url ) != "0" ){
  77. echo post::get_embeded_video( post::get_vimeo_video_id( $video_url ) , "vimeo" );
  78. }
  79. }else{
  80. echo post::get_local_video( urlencode(wp_get_attachment_url($videoid)));
  81. }
  82. }
  83. }
  84.  
  85. ?>
  86. </div>
  87. <?php
  88. }
  89.  
  90. //---------------------------
  91.  
  92. if(get_post_format($post->ID)=="image" && !(isset($single_slideshow) && strlen($single_slideshow)) )
  93. {
  94. $image_format = meta::get_meta( $post -> ID , 'format' );
  95.  
  96. if(isset($image_format['images']) && is_array($image_format['images']))
  97. {
  98. echo "<div class=\"attached-image-gallery\">";
  99. echo '<div class="row">';
  100. if ( ! post_password_required() ) {
  101. foreach($image_format['images'] as $index=>$img_id)
  102. {
  103. //$thumbnail= wp_get_attachment_image_src( $img_id, 't_attached_gallery');
  104. $full_image=wp_get_attachment_url($img_id);
  105.  
  106. $size = 'image_format';
  107.  
  108. $img_url = wp_get_attachment_url( $img_id ,'full'); //get img URL
  109.  
  110. $thumbnail = aq_resize( $img_url, get_aqua_size($size), get_aqua_size($size, 'height'), true, false); //crop img
  111.  
  112.  
  113. $url=$thumbnail[0];
  114. $width=$thumbnail[1];
  115. $height=$thumbnail[2];
  116. echo '<div class="three columns mobile-one">';
  117. echo "<div class=\"attached-image-gallery-elem\">";
  118. echo "<a title=\"\" data-rel=\"prettyPhoto[".get_the_ID()."]\" href=\"".$full_image."\">";
  119.  
  120. if($height<150)
  121. {
  122. $vertical_align_style="style=\"margin-top:".((150-$height)/2)."px;\"";
  123. }
  124. else
  125. {
  126. $vertical_align_style="";
  127. }
  128.  
  129. echo "<img alt=\"\" src=\"$url\" $vertical_align_style>";
  130. echo "</a>";
  131. echo "</div>";
  132. echo "</div>";
  133. }
  134. };
  135. echo "</div>";
  136. echo "</div>";
  137. }
  138.  
  139. }
  140.  
  141. the_content();
  142.  
  143. ?>
  144. <div class="pagenumbers">
  145. <?php wp_link_pages(array('before' => '<p>Pages:','after' => '</p>', 'next_or_number' => 'number')); ?>
  146. </div>
  147. <?php
  148. if( get_post_format( $post -> ID ) == 'link' ){
  149. echo post::get_attached_file( $post -> ID );
  150. }
  151.  
  152. ?>
  153.  
  154. <?php
  155. $tags = wp_get_post_terms($post->ID, 'post_tag');
  156.  
  157. if (!empty($tags)) {
  158. ?>
  159. <div class="tabs-container clear single-tags">
  160. <?php
  161. foreach ($tags as $tag) {
  162. $t = get_tag($tag);
  163. echo '<a href="' . get_tag_link($tag) . '" rel="tag" class="tag">' . $t->name . '</a>';
  164. }
  165. ?>
  166.  
  167. </div>
  168. <?php
  169. }
  170. ?>
  171.  
  172. <?php
  173. if (options::get_value( 'blog_post' , 'post_sharing' ) == 'yes' && meta::logic( $post , 'settings' , 'sharing' )) {
  174. /*Add here social sharing*/
  175. get_template_part('social-sharing');
  176. }
  177. ?>
  178.  
  179. </div>
  180. <?php
  181. if(is_singular()){
  182.  
  183. /*related posts*/
  184. if(is_single()){
  185. get_template_part('related-posts');
  186. }
  187.  
  188. /*comments*/
  189. if( comments_open() ){
  190. ?>
  191. <div class="row">
  192. <div class="cosmo-comments twelve columns">
  193. <?php
  194. if( options::logic( 'general' , 'fb_comments' ) ){
  195. ?>
  196. <h3 id="reply-title">
  197. <span>
  198. <?php
  199. $comments_label = sprintf(__('Leave a comment','cosmotheme'));
  200. echo $comments_label;
  201. ?>
  202. </span>
  203. </h3>
  204.  
  205. <fb:comments href="<?php the_permalink(); ?>" num_posts="5" width="430" height="120" reverse="true"></fb:comments>
  206.  
  207. <?php
  208. }else{
  209. comments_template( '', true );
  210. }
  211. ?>
  212. </div>
  213. </div>
  214. <?php
  215. }
  216. }
  217.  
  218. ?>
  219. </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement