codebloo

Luxury Listing - PODS

Feb 12th, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. <?php
  2. /*Template Name: Listing Overview
  3. */
  4. get_header(); ?>
  5. <?php if ( function_exists('yoast_breadcrumb') ) {
  6. yoast_breadcrumb('<p id="breadcrumbs">','</p>');
  7. } ?>
  8.  
  9. <div id="mainContent" class="clearfix">
  10.  
  11. <?php
  12. $listing = new Pod('listings');
  13. $params = array(
  14. 'search' => false,
  15. 'pagination' => false,
  16. 'limit' => -1,
  17. 'where'=>'active=1',
  18. 'orderby' =>'listing_price DESC');
  19. $listing->find($params);
  20. $total_listings = $listing->total(); ?>
  21.  
  22. <?php $count = 1; ?>
  23. <?php if( $total_listings>0 ) : ?>
  24. <?php while ( $listing->fetchRecord() ) : ?>
  25.  
  26. <?php
  27.  
  28. // set our variables
  29. $listing_id = $listing->get_field('id');
  30. $listing_name = $listing->get_field('name');
  31. $listing_active = $listing->get_field('active');
  32. $listing_address = $listing->get_field('listing_address');
  33. $listing_price = $listing->get_field('listing_price');
  34. $listing_status = $listing->get_field('listing_status');
  35. $listing_soldprice = $listing->get_field('sold_price');
  36. $listing_bathrooms = $listing->get_field('listing_bedrooms');
  37. $listing_bedrooms = $listing->get_field('listing_bedrooms');
  38. $listing_photo = $listing->get_field('thumbnail');
  39. $listing_slug = $listing->get_field('permalink');
  40.  
  41. // data cleanup
  42. $listing_description = wpautop( $listing_description );
  43. $listing_photo = $listing_photo[0]['guid'];
  44.  
  45.  
  46. ?>
  47.  
  48.  
  49.  
  50.  
  51. <?php if ($listing->get_field('listing_status.name') == 'In Escrow'):?>
  52. <?php $listing_class = "<div class='listing_banner'><img class='listing-banner-small' src='http://clients.codebloo.com/luxury/wp-content/themes/luxury/images/banner_in-escrow.png'></div>"?>
  53.  
  54. <?php elseif ($listing->get_field('listing_status.name') == 'Sold'):?>
  55. <?php $listing_class = "<div class='listing_banner'><img class='listing-banner-small' src='http://clients.codebloo.com/luxury/wp-content/themes/luxury/images/banner_sold.png'></div>" ?>
  56.  
  57. <?php else:?>
  58.  
  59. <?php $listing_class = "" ?>
  60.  
  61.  
  62. <?php endif; ?>
  63.  
  64.  
  65. <div class="listings clearfix <?php if ($count % 3 == 0) { ?> last<?php } ?>" id="listing<?php echo $listing_id; ?>">
  66. <?php echo $listing_class; ?>
  67. <div class="listing-image listing-image-small"> <a rel="bookmark" title="<?php echo $listing_name; ?>" href="<?php echo $listing_slug; ?>">
  68. <?php foreach ($listing->get_field('thumbnail') as $listing_photo) {
  69. $thumbnail = wp_get_attachment_image_src( $listing_photo[ID], 'listing' );
  70. echo "<img src='$thumbnail[0]' class='listings-img' title='$listing_name'/>";}?>
  71.  
  72. </a></div>
  73.  
  74. <div class="details">
  75. <a rel="bookmark" title="<?php echo $listing_name; ?>" href="<?php echo $listing_slug; ?>"><div class="list_address"><?php echo $listing_address; ?></div>
  76. <div class="price"><?php echo $listing_price; ?></div>
  77. <div class="detail"><?php echo $listing_bedrooms; ?> Bedrooms, <?php echo $listing_bathrooms; ?> Bathrooms</div>
  78. </a> </div>
  79.  
  80. </div>
  81. <?php $count++; ?>
  82. <?php endwhile ?>
  83. <?php endif ?>
  84. </div>
  85. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment