Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #
- # rt-theme loop
- #
- global $args,$content_width;
- add_filter('excerpt_more', 'no_excerpt_more');
- $image_width = ($content_width =="960") ? 940 : 606;
- $image_height = ($content_width =="960") ? 500 : 380;
- if ($args) query_posts($args);
- if ( have_posts() ) : while ( have_posts() ) : the_post();
- ?>
- <?php
- #
- # featured images
- #
- $rt_gallery_images = (get_post_meta( $post->ID, THEMESLUG . "rt_gallery_images", true )) ? get_post_meta( $post->ID, THEMESLUG . "rt_gallery_images", true ) : "";
- $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 ) : "";
- $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 ) : "";
- $fist_featured_image = (is_array($rt_gallery_images)) ? find_image_org_path($rt_gallery_images[0]) : "";
- $resize = (get_post_meta($post->ID, THEMESLUG.'blog_image_resize', true)) ? true : false;
- $is_old_post = (get_post_meta($post->ID, THEMESLUG.'is_old_post', true)=="1") ? false : true;
- $crop = (get_post_meta($post->ID, THEMESLUG.'blog_image_crop', true)) ? true : false;
- $width = (get_post_meta($post->ID, THEMESLUG.'blog_image_width', true)) ? get_post_meta($post->ID, THEMESLUG.'blog_image_width', true) : $image_width;
- $meta_height = get_post_meta($post->ID, THEMESLUG.'blog_image_height', true);
- $height = (!$meta_height && !$crop) ? 10000 : (($meta_height && !$crop) ? $meta_height : ($meta_height && $crop) ? $meta_height : $image_height);
- $img_position = (get_post_meta($post->ID, THEMESLUG.'featured_image_position', true)) ? get_post_meta($post->ID, THEMESLUG.'featured_image_position', true): "center";
- $post_class_img = "featured_image_".$img_position;
- $featured_image_usage = get_post_meta($post->ID, THEMESLUG .'_featured_image_usage', true);
- $display_gallery_images = get_post_meta($post->ID, THEMESLUG .'_display_gallery_images', true);
- $post_format = !get_post_format() ? "post" : get_post_format();
- $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;
- $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;
- $imageURL = "";
- $post_uniqueID = 'post-'.get_the_ID().'';
- if($is_old_post && !$resize) $resize = true; //activate resizer for old posts
- //standart post types
- if($post_format == "post"){
- if($fist_featured_image && $resize) { // if resize is on
- $image = @vt_resize('', $fist_featured_image, $width, $height, $crop );
- $imageURL = $image["url"];
- }else{
- $imageURL = $fist_featured_image;
- }
- }
- //gallery post types
- if($post_format == "gallery"){
- $imageURL = $fist_featured_image;
- }
- ?>
- <!-- blog box-->
- <div id="post-<?php the_ID(); ?>" <?php post_class('box one box-shadow '); ?>>
- <!-- blog box-->
- <div class="box full blog">
- <!-- blog headline-->
- <h5><a href="<?php echo get_permalink() ?>" title="<?php the_title(); ?>">
- <?php
- $the_title = search_highlight(trim(get_search_query()), get_the_title());
- echo $the_title;
- ?>
- </a></h5>
- <!-- / blog headline-->
- <?php
- #
- # Standart post featured image
- #
- if ( $fist_featured_image && ($post_format == "post" || ($display_gallery_images == "only_featured_image" && $post_format == "gallery"))):?>
- <!-- blog image-->
- <a href="<?php echo get_permalink() ?>" title="<?php echo $rt_gallery_image_titles[0]; ?>" class="imgeffect link align<?php echo $img_position;?>">
- <img src="<?php echo $imageURL;?>" class="featured_image" alt="<?php echo $rt_gallery_image_descs[0]; ?>" /></a>
- <!-- / blog image -->
- <?php if($img_position=="center"):?>
- <div class="space margin-t20"></div>
- <?php endif;?>
- <?php endif;?>
- <?php if(get_the_excerpt()):?>
- <!-- blog text-->
- <?php
- $the_excerpt = apply_filters('the_content',(get_the_excerpt()));
- $the_excerpt = search_highlight(trim(get_search_query()), $the_excerpt);
- echo $the_excerpt;
- ?>
- <!-- /blog text-->
- <?php endif;?>
- </div>
- <div class="clear"></div>
- </div>
- <div class="space margin-b20"></div>
- <!-- blog box-->
- <?php endwhile; ?>
- <div class="clear"></div>
- <?php
- //get page and post counts
- $page_count=get_page_count();
- //show pagination if page count bigger then 1
- if ($page_count['page_count']>1):
- ?>
- <!-- paging-->
- <div class="paging_wrapper">
- <ul class="paging">
- <?php get_pagination(); ?>
- </ul>
- </div>
- <!-- / paging-->
- <?php endif;?>
- <?php wp_reset_query();?>
- <?php else: ?>
- <p><?php _e( 'Sorry, no posts matched your criteria.', 'rt_theme'); ?></p>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment