Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<div id="breadcrumb"><p>','</p></div>'); } ?>
- <?php
- //RELATED PROPERTIES - BY LOCATION
- $similar_results = chop($similar_results,',');
- $query_args = array( 'post_type' => $post->post_type,
- 'post__not_in' => array($post->ID),
- 'tax_query' => array(
- array(
- 'taxonomy' => $woo_options['woo_single_listing_related_taxonomy'],
- 'field' => 'slug',
- 'terms' => $similar_results
- )
- ),
- 'posts_per_page' => 3,
- 'orderby' => 'rand'
- );
- $related_query = new WP_Query($query_args);
- if ($related_query->have_posts()) : $count = 0; ?>
- <div class="similar-listings">
- <h2 class="cufon"><?php echo stripslashes( $woo_options['woo_single_listing_similar_listings_title'] ) ?></h2>
- <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
- <?php
- $listing_image_caption = get_post_meta($post->ID,$woo_options['woo_single_listing_image_caption'],true);
- if ($listing_image_caption != '' && $woo_options['woo_single_listing_image_caption'] == 'price') { $listing_image_caption = number_format($listing_image_caption , 0 , '.', ','); }
- ?>
- <div class="block">
- <a href="<?php the_permalink(); ?>">
- <?php // woo_image('id='.$post->ID.'&key=image&width=296&height=174&link=img'); ?>
- <?php
- if ( $post->ID > 0 ) {
- // If a featured image is available, use it in priority over the "image" field.
- if ( function_exists( 'has_post_thumbnail' ) && current_theme_supports( 'post-thumbnails' ) ) {
- if ( has_post_thumbnail( $post->ID ) ) {
- $_id = 0;
- $_id = get_post_thumbnail_id( $post->ID );
- if ( intval( $_id ) ) {
- $_image = array();
- $_image = wp_get_attachment_image_src( $_id, 'full' );
- // $_image should have 3 indexes: url, width and height.
- if ( count( $_image ) ) {
- $_image_url = $_image[0];
- woo_image('src=' . $_image_url . '&key=image&width=296&height=174&link=img');
- } // End IF Statement
- } // End IF Statement
- } else {
- woo_image('id='.$post->ID.'&key=image&width=296&height=174&link=img');
- } // End IF Statement
- } else {
- woo_image('id='.$post->ID.'&key=image&width=296&height=174&link=img');
- } // End IF Statement
- } // End IF Statement
- ?>
- </a>
- <?php if ($listing_image_caption != '') { ?><span class="price"><?php if ($woo_options['woo_single_listing_image_caption'] == 'price') { ?><?php echo $woo_options['woo_listings_currency'].$listing_image_caption; ?><?php } else { echo $listing_image_caption; } ?></span><?php } ?>
- <h2 class="cufon"><?php the_title(); ?></h2>
- <?php the_excerpt(); ?>
- <span class="more"><a href="<?php the_permalink(); ?>"><?php _e('More Info', 'woothemes') ?></a></span>
- </div>
- <?php endwhile; ?>
- </div><!-- /.more-listings -->
- <div class="fix"></div>
- <?php else: endif; ?>
Add Comment
Please, Sign In to add comment