Guest User

Untitled

a guest
Feb 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<div id="breadcrumb"><p>','</p></div>'); } ?>
  2.  
  3.  
  4. <?php
  5. //RELATED PROPERTIES - BY LOCATION
  6. $similar_results = chop($similar_results,',');
  7. $query_args = array( 'post_type' => $post->post_type,
  8. 'post__not_in' => array($post->ID),
  9. 'tax_query' => array(
  10. array(
  11. 'taxonomy' => $woo_options['woo_single_listing_related_taxonomy'],
  12. 'field' => 'slug',
  13. 'terms' => $similar_results
  14. )
  15. ),
  16. 'posts_per_page' => 3,
  17. 'orderby' => 'rand'
  18. );
  19.  
  20. $related_query = new WP_Query($query_args);
  21. if ($related_query->have_posts()) : $count = 0; ?>
  22.  
  23. <div class="similar-listings">
  24. <h2 class="cufon"><?php echo stripslashes( $woo_options['woo_single_listing_similar_listings_title'] ) ?></h2>
  25.  
  26. <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
  27. <?php
  28. $listing_image_caption = get_post_meta($post->ID,$woo_options['woo_single_listing_image_caption'],true);
  29. if ($listing_image_caption != '' && $woo_options['woo_single_listing_image_caption'] == 'price') { $listing_image_caption = number_format($listing_image_caption , 0 , '.', ','); }
  30. ?>
  31. <div class="block">
  32. <a href="<?php the_permalink(); ?>">
  33. <?php // woo_image('id='.$post->ID.'&key=image&width=296&height=174&link=img'); ?>
  34. <?php
  35. if ( $post->ID > 0 ) {
  36.  
  37. // If a featured image is available, use it in priority over the "image" field.
  38. if ( function_exists( 'has_post_thumbnail' ) && current_theme_supports( 'post-thumbnails' ) ) {
  39.  
  40. if ( has_post_thumbnail( $post->ID ) ) {
  41.  
  42. $_id = 0;
  43. $_id = get_post_thumbnail_id( $post->ID );
  44.  
  45. if ( intval( $_id ) ) {
  46.  
  47. $_image = array();
  48. $_image = wp_get_attachment_image_src( $_id, 'full' );
  49.  
  50. // $_image should have 3 indexes: url, width and height.
  51. if ( count( $_image ) ) {
  52.  
  53. $_image_url = $_image[0];
  54.  
  55. woo_image('src=' . $_image_url . '&key=image&width=296&height=174&link=img');
  56.  
  57. } // End IF Statement
  58.  
  59. } // End IF Statement
  60.  
  61. } else {
  62.  
  63. woo_image('id='.$post->ID.'&key=image&width=296&height=174&link=img');
  64.  
  65. } // End IF Statement
  66.  
  67. } else {
  68.  
  69. woo_image('id='.$post->ID.'&key=image&width=296&height=174&link=img');
  70.  
  71. } // End IF Statement
  72.  
  73. } // End IF Statement
  74. ?>
  75. </a>
  76. <?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 } ?>
  77. <h2 class="cufon"><?php the_title(); ?></h2>
  78. <?php the_excerpt(); ?>
  79. <span class="more"><a href="<?php the_permalink(); ?>"><?php _e('More Info', 'woothemes') ?></a></span>
  80. </div>
  81.  
  82. <?php endwhile; ?>
  83.  
  84. </div><!-- /.more-listings -->
  85. <div class="fix"></div>
  86.  
  87. <?php else: endif; ?>
Add Comment
Please, Sign In to add comment