RtThemesSupport

rt-17-listloop

May 8th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 KB | None | 0 0
  1. <?php
  2. #
  3. # rt-theme loop
  4. #
  5.  
  6. global $args;
  7. add_filter('excerpt_more', 'no_excerpt_more');
  8.  
  9. if ($args) query_posts($args);
  10.  
  11. if ( have_posts() ) : while ( have_posts() ) : the_post();
  12.  
  13. ?>
  14.  
  15.  
  16. <?php
  17. #
  18. # featured images
  19. #
  20. $rt_gallery_images = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_images", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_images", true ) : "";
  21. $rt_gallery_image_titles = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_titles", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_titles", true ) : "";
  22. $rt_gallery_image_descs = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_descs", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_image_descs", true ) : "";
  23. $fist_featured_image = (is_array($rt_gallery_images)) ? find_image_org_path($rt_gallery_images[0]) : "";
  24. $resize = (get_post_meta($post->ID, THEMESLUG.'blog_image_resize', true)) ? true : false;
  25. $is_old_post = (get_post_meta($post->ID, THEMESLUG.'is_old_post', true)=="1") ? false : true;
  26. $crop = (get_post_meta($post->ID, THEMESLUG.'blog_image_crop', true)) ? true : false;
  27. $width = (get_post_meta($post->ID, THEMESLUG.'blog_image_width', true)) ? get_post_meta($post->ID, THEMESLUG.'blog_image_width', true) : $image_width;
  28. $meta_height = get_post_meta($post->ID, THEMESLUG.'blog_image_height', true);
  29. $height = (!$meta_height && !$crop) ? 10000 : (($meta_height && !$crop) ? $meta_height : ($meta_height && $crop) ? $meta_height : $image_height);
  30. $img_position = (get_post_meta($post->ID, THEMESLUG.'featured_image_position', true)) ? get_post_meta($post->ID, THEMESLUG.'featured_image_position', true): "center";
  31. $post_class_img = "featured_image_".$img_position;
  32. $featured_image_usage = get_post_meta($post->ID, THEMESLUG .'_featured_image_usage', true);
  33. $display_gallery_images = get_post_meta($post->ID, THEMESLUG .'_display_gallery_images', true);
  34. $post_format = !get_post_format() ? "post" : get_post_format();
  35. $photo_gallery_images_width = (get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_width", true )) ? get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_width", true ) : 160;
  36. $photo_gallery_images_height = (get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_height", true )) ? get_post_meta( $post->ID, THEMESLUG . "photo_gallery_images_height", true ) : 160;
  37. $imageURL = "";
  38. $post_uniqueID = 'post-'.get_the_ID().'';
  39.  
  40. if($is_old_post && !$resize) $resize = true; //activate resizer for old posts
  41.  
  42. //standart post types
  43. if($post_format == "post"){
  44. if($fist_featured_image && $resize) { // if resize is on
  45. $image = @vt_resize('', $fist_featured_image, $width, $height, $crop );
  46. $imageURL = $image["url"];
  47. }else{
  48. $imageURL = $fist_featured_image;
  49. }
  50. }
  51.  
  52.  
  53. //gallery post types
  54. if($post_format == "gallery"){
  55. $imageURL = $fist_featured_image;
  56. }
  57. ?>
  58.  
  59. <!-- blog box-->
  60. <div id="post-<?php the_ID(); ?>" <?php post_class('box one box-shadow '); ?>>
  61.  
  62. <!-- blog box-->
  63. <div class="box full blog">
  64.  
  65. <!-- blog headline-->
  66. <h5><a href="<?php echo get_permalink() ?>" title="<?php the_title(); ?>">
  67. <?php
  68. $the_title = search_highlight(trim(get_search_query()), get_the_title());
  69. echo $the_title;
  70. ?>
  71. </a></h5>
  72. <!-- / blog headline-->
  73. <?php
  74.  
  75. #
  76. # Standart post featured image
  77. #
  78.  
  79. if ( $fist_featured_image && ($post_format == "post" || ($display_gallery_images == "only_featured_image" && $post_format == "gallery"))):?>
  80. <!-- blog image-->
  81. <a href="<?php echo get_permalink() ?>" title="<?php echo $rt_gallery_image_titles[0]; ?>" class="imgeffect link align<?php echo $img_position;?>">
  82. <img src="<?php echo $imageURL;?>" class="featured_image" alt="<?php echo $rt_gallery_image_descs[0]; ?>" />
  83. </a>
  84. <!-- / blog image -->
  85.  
  86. <?php if($img_position=="center"):?>
  87. <div class="space margin-t20"></div>
  88. <?php endif;?>
  89.  
  90.  
  91. <?php if(get_the_excerpt()):?>
  92. <!-- blog text-->
  93. <?php
  94. $the_excerpt = apply_filters('the_content',(get_the_excerpt()));
  95. $the_excerpt = search_highlight(trim(get_search_query()), $the_excerpt);
  96. echo $the_excerpt;
  97. ?>
  98. <!-- /blog text-->
  99. <?php endif;?>
  100. <?php endif;?>
  101. </div>
  102.  
  103. <div class="clear"></div>
  104. </div>
  105.  
  106. <div class="space margin-b20"></div>
  107.  
  108. <!-- blog box-->
  109.  
  110.  
  111. <?php endwhile; ?>
  112.  
  113. <div class="clear"></div>
  114.  
  115. <?php
  116. //get page and post counts
  117. $page_count=get_page_count();
  118.  
  119. //show pagination if page count bigger then 1
  120. if ($page_count['page_count']>1):
  121. ?>
  122.  
  123. <!-- paging-->
  124. <div class="paging_wrapper">
  125. <ul class="paging">
  126. <?php get_pagination(); ?>
  127. </ul>
  128. </div>
  129. <!-- / paging-->
  130.  
  131. <?php endif;?>
  132.  
  133. <?php wp_reset_query();?>
  134.  
  135. <?php else: ?>
  136. <p><?php _e( 'Sorry, no posts matched your criteria.', 'rt_theme'); ?></p>
  137. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment