Advertisement
Guest User

Untitled

a guest
Jun 26th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. <?php
  2.  
  3. $options = get_option('sf_supreme_options');
  4. $use_disqus = $options['use_disqus'];
  5. $blog_type = $options['archive_display_type'];
  6.  
  7. $post_title = get_the_title();
  8. $post_author = '<a href="'.get_author_posts_url( get_the_author_meta( 'ID' ) ).'" >'.get_the_author_meta('display_name').'</a>';
  9. $post_date = get_the_date();
  10. $post_categories = sf_get_custom_post_cat_list($post->ID);
  11. $post_comments = get_comments_number();
  12. $post_permalink = get_permalink();
  13. $custom_excerpt = get_post_meta($post->ID, 'sf_custom_excerpt', true);
  14. $post_excerpt = '';
  15. if ($custom_excerpt != '') {
  16. $post_excerpt = $custom_excerpt;
  17. } else {
  18. $post_excerpt = get_the_excerpt();
  19. }
  20. $post_content = get_the_content();
  21.  
  22. $thumb_image = $thumb_width = $thumb_height = $bordered_thumb_width = $bordered_thumb_height = $video = $video_height = $bordered_video_height = $item_class = $link_config = $item_icon = '';
  23.  
  24. if ($blog_type == "mini") {
  25. $thumb_width = 446;
  26. $thumb_height = NULL;
  27. $video_height = 250;
  28. } else {
  29. $thumb_width = 640;
  30. $thumb_height = NULL;
  31. $video_height = 360;
  32. $bordered_thumb_width = 408;
  33. $bordered_thumb_height = 303;
  34. $bordered_video_height = 303;
  35. }
  36.  
  37. $thumb_type = get_post_meta($post->ID, 'sf_thumbnail_type', true);
  38. $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
  39. $thumb_video = get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
  40. $thumb_gallery = rwmb_meta( 'sf_thumbnail_gallery', 'type=image&size=blog-image' );
  41. $thumb_link_type = get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
  42. $thumb_link_url = get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
  43. $thumb_lightbox_thumb = rwmb_meta( 'sf_thumbnail_image', 'type=image&size=large' );
  44. $thumb_lightbox_image = rwmb_meta( 'sf_thumbnail_link_image', 'type=image&size=large' );
  45. $thumb_lightbox_video_url = get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
  46.  
  47. foreach ($thumb_image as $detail_image) {
  48. $thumb_img_url = $detail_image['url'];
  49. break;
  50. }
  51.  
  52. if (!$thumb_image) {
  53. $thumb_image = get_post_thumbnail_id();
  54. $thumb_img_url = wp_get_attachment_url( $thumb_image, 'full' );
  55. }
  56.  
  57. $thumb_lightbox_img_url = wp_get_attachment_url( $thumb_lightbox_image, 'full' );
  58.  
  59. $item_figure = $link_config = "";
  60.  
  61. // LINK TYPE VARIABLES
  62. if ($thumb_link_type == "link_to_url") {
  63. $link_config = 'href="'.$thumb_link_url.'" class="link-to-url"';
  64. $item_icon = "link";
  65. } else if ($thumb_link_type == "link_to_url_nw") {
  66. $link_config = 'href="'.$thumb_link_url.'" class="link-to-url" target="_blank"';
  67. $item_icon = "link";
  68. } else if ($thumb_link_type == "lightbox_thumb") {
  69. $link_config = 'href="'.$thumb_img_url.'" class="view"';
  70. $item_icon = "search";
  71. } else if ($thumb_link_type == "lightbox_image") {
  72. $lightbox_image_url = '';
  73. foreach ($thumb_lightbox_image as $image) {
  74. $lightbox_image_url = $image['full_url'];
  75. }
  76. $link_config = 'href="'.$lightbox_image_url.'" class="view"';
  77. $item_icon = "search";
  78. } else if ($thumb_link_type == "lightbox_video") {
  79. $link_config = 'href="'.$thumb_lightbox_video_url.'" class="fancybox-media"';
  80. $item_icon = "facetime-video";
  81. } else {
  82. $link_config = 'href="'.$post_permalink.'" class="link-to-post"';
  83. $item_icon = "file-alt";
  84. }
  85.  
  86. // THUMBNAIL MEDIA TYPE SETUP
  87.  
  88. if ($thumb_type != "none") {
  89.  
  90. $item_figure .= '<figure>';
  91.  
  92. if ($thumb_type == "video") {
  93.  
  94. $video = video_embed($thumb_video, $thumb_width, $video_height);
  95.  
  96. $item_figure .= $video;
  97.  
  98. } else if ($thumb_type == "slider") {
  99.  
  100. $item_figure .= '<div class="flexslider thumb-slider"><ul class="slides">';
  101.  
  102. foreach ( $thumb_gallery as $image )
  103. {
  104. $item_figure .= "<li><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></li>";
  105. }
  106.  
  107. $item_figure .= '</ul><div class="open-item"><a '.$link_config.'><i class="icon-plus"></i></a></div></div>';
  108.  
  109. } else {
  110.  
  111. $image = aq_resize( $thumb_img_url, $thumb_width, $thumb_height, true, false);
  112.  
  113. if ($image) {
  114.  
  115. $item_figure .= '<a '.$link_config.'>';
  116.  
  117. if ($blog_type == "masonry") {
  118.  
  119. $item_figure .= '<div class="overlay"><div class="thumb-info">';
  120. $item_figure .= '<i class="icon-'.$item_icon.'"></i>';
  121. $item_figure .= '</div></div>';
  122.  
  123. }
  124.  
  125. $item_figure .= '<img src="'.$image[0].'" width="'.$image[1].'" height="'.$image[2].'" />';
  126.  
  127. $item_figure .= '</a>';
  128. }
  129. }
  130.  
  131. $item_figure .= '</figure>';
  132.  
  133. }
  134.  
  135. ?>
  136.  
  137. <?php echo $item_figure; ?>
  138. <div class="blog-details-wrap">
  139. <div class="item-cats"><?php echo $post_categories; ?></div>
  140. <?php if ($blog_type == "masonry") { ?>
  141. <h4><a href="<?php echo $post_permalink; ?>"><?php echo $post_title; ?></a></h4>
  142. <?php } else { ?>
  143. <h3><a href="<?php echo $post_permalink; ?>"><?php echo $post_title; ?></a></h3>
  144. <?php } ?>
  145. <div class="blog-item-details clearfix"><?php printf(__('By %1$s on %2$s', 'swiftframework'), $post_author, $post_date); ?></div>
  146. <div class="excerpt"><?php echo $post_excerpt; ?></div>
  147. <div class="read-more-bar">
  148. <a class="read-more" href="<?php echo $post_permalink; ?>"><img src="http://lustrelife.com/news/wp-content/themes/supreme-child/img/readmore.jpg"></a>
  149. <div class="comments-likes">
  150. <?php if ( comments_open() ) {
  151. if ($use_disqus) { ?>
  152. <i class="icon-comments"></i><?php disqus_count(); ?>
  153. <?php } else { ?>
  154. <i class="icon-comments"></i><?php echo $post_comments; ?>
  155. <?php }
  156. } ?>
  157. <?php if (function_exists( 'lip_love_it_link' )) {
  158. echo lip_love_it_link(get_the_ID(), '<i class="icon-heart"></i>', '<i class="icon-heart"></i>');
  159. } ?>
  160. </div>
  161. </div>
  162. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement