Advertisement
Guest User

Untitled

a guest
Oct 7th, 2018
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.34 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Properties by Contract Type
  4. */
  5. get_header(); ?>
  6. <?php // get_breadcrumbs();?>
  7. <?php ale_part('filter-form');
  8. if(!isset($_GET['orderby'])){
  9. // $_GET['orderby']='price-desc';
  10. $_GET['orderby']='date-desc';
  11. }
  12. ?>
  13. <div class="wrapper<?php if(ale_get_option('propertiessidebar')=='2c-l-fixed'){ echo " prop_left_sidebar_position";} if(ale_get_option('propertiessidebar')=='1col-fixed'){ echo " prop_full_with_nosidebar";} ?> cf">
  14.  
  15. <section class="archive-page test-luster-prop-contract <?php if(ale_get_option('propertiessidebar')!=='1col-fixed'){ ?>col-9<?php } ?>">
  16. <div class="archive-title">
  17. <h2><?php wp_title("", true); ?></h2>
  18.  
  19. <div class="article-filter">
  20. <select id="ale-sort-properties" class="dropdown orderby" name="ale-sort-properties">
  21. <option value="price-desc" <?php if(isset($_GET['orderby'])){echo ($_GET['orderby']=='price-desc')?'selected':''; }?>><?php _e('Price, highest first','aletheme');?></option>
  22. <option value="price-asc" <?php if(isset($_GET['orderby'])){echo ($_GET['orderby']=='price-asc')?'selected':''; }?>><?php _e('Price, lower first','aletheme');?></option>
  23. <option value="date-asc" <?php if(isset($_GET['orderby'])){echo ($_GET['orderby']=='date-asc')?'selected':''; }?>><?php _e('Date, old first','framework');?></option>
  24. <option value="date-desc" <?php if(isset($_GET['orderby'])){echo ($_GET['orderby']=='date-desc')?'selected':''; }?>><?php _e('Date, new first','framework');?></option>
  25. </select>
  26. </div>
  27.  
  28. <div class="grid-change">
  29. <div class="item fullwidth"></div>
  30. <div class="item partwidth"></div>
  31. </div>
  32. </div>
  33.  
  34. <div class="articles">
  35. <?php
  36. wp_reset_query();
  37.  
  38. $properties_per_page = intval(ale_get_option('properties_per_page'));
  39. if(!$properties_per_page){
  40. $properties_per_page = 5;
  41. }
  42.  
  43. $paged = 1;
  44. if ( get_query_var('paged') ) $paged = get_query_var('paged');
  45. if ( get_query_var('page') ) $paged = get_query_var('page');
  46.  
  47.  
  48. if(ale_get_meta('templatepropertycontract')){
  49. $contract_value = ale_get_meta('templatepropertycontract');
  50. } else {
  51. $contract_value = '';
  52. }
  53.  
  54. // $ale_property_listing_args = array(
  55. // 'post_type' => 'properties',
  56. // 'type-category' => array('townhouses', 'villa','apartments-condos', 'commercial', 'townhouses-fr', 'villa-fr','apartments-condos-fr', 'commercial-fr' ),
  57. // // 'type-category' => array('townhouses', 'villa','apartments-condos', 'commercial' ),
  58. // 'posts_per_page' => $properties_per_page,
  59. // 'paged' => $paged,
  60. // 'meta_query' => array(
  61. // array(
  62. // 'key' => 'ale_propertycontract',
  63. // 'value' => $contract_value
  64. // )
  65. // )
  66. // );
  67. /*Begin code to ensure 'Property For Sale' page does not display sold properties.*/
  68. $ale_property_listing_args = array(
  69. 'post_type' => 'properties',
  70.  
  71.  
  72. // 'type-category' => array('townhouses', 'villa','apartments-condos', 'commercial', 'townhouses-fr', 'villa-fr','apartments-condos-fr', 'commercial-fr' ),
  73.  
  74. 'type-category' => array('townhouses', 'villa','apartments-condos', 'commercial', 'townhouses-fr', 'villa-fr','apartments-condos-fr', 'commercial-fr', 'townhouses-zh-hans', 'villa-zh-hans','apartments-condos-zh-hans', 'commercial-zh-hans' ),
  75.  
  76. 'posts_per_page' => $properties_per_page,
  77. 'paged' => $paged,
  78. 'meta_query' => array(
  79. array(
  80. 'key' => 'ale_propertycontract',
  81. 'value' => $contract_value
  82. ),
  83. array(
  84. 'relation' => 'OR',
  85. array(
  86. 'key' => '_my_checkbox_metakey',
  87. 'value' => '1',
  88. 'compare' => '!='
  89. ),
  90. array(
  91. 'key' => '_my_checkbox_metakey',
  92. 'compare' => 'NOT EXISTS'
  93. )
  94. )
  95. )
  96. );
  97. /*End code to ensure 'Property For Sale' page does not display sold properties.*/
  98.  
  99. $ale_property_listing_args = ale_sort_properties($ale_property_listing_args);
  100. $ale_property_listing_query = new WP_Query( $ale_property_listing_args );
  101. //print_r($ale_property_listing_args);
  102.  
  103. if ( $ale_property_listing_query->have_posts() ) {;
  104. while ( $ale_property_listing_query->have_posts() ) { $ale_property_listing_query->the_post();
  105. ale_part('property-item');
  106. }
  107.  
  108. echo ale_page_links_custom($ale_property_listing_query);
  109.  
  110. } else {
  111. echo '<article class="not-found"><div class="text-wrapper story"><h3>'.__('Not found','aletheme').'</h3></div></article>';
  112. }
  113. ?>
  114. </div>
  115. </section>
  116.  
  117. <?php if(ale_get_option('propertiessidebar')!=='1col-fixed'){ ?>
  118. <aside class="sidebar col-3">
  119. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('properties-sidebar') ) : endif; ?>
  120. </aside>
  121. <?php } ?>
  122. <?php
  123. wp_reset_postdata();
  124. $id_current=get_the_id();
  125. if($id_current==7786) {
  126. ?>
  127. <div class="after-copy">
  128. <h1>Koh Samui Villas for Rent</h1>
  129. <p>Koh Samui is the crown jewel of the tropical Thai south and one of the most popular island destinations throughout the Kingdom. Horizon Homes, an internationally accredited real estate agency, offers holidaymakers and parties interested in long-term island stays, the best Samui <b>villas for rent.</b></p>
  130. <p>Our upscale villas take luxurious living to new levels. Ideally located in an exclusive gated community on an idyllic hillside <b>near Choeng Mon beach</b>, they offer spectacular views and a tranquil location set amongst palm trees nearby to one of the most striking beaches the tropical island paradise of Koh Samui has to offer.</p>
  131. <p>If you’re looking the most luxurious villas for rent on Koh Samui, then our collection of 2, 3, 4 and 5 bedroom villa rentals are sure to tick all your boxes.</p>
  132. <h1>Our Villas </h1>
  133. <p>As one of the most established real estate and property development agencies on Koh Samui, Horizon Homes is perfectly positioned to assist you with all your holiday villa rental needs.</p>
  134. <p>We currently offer discerning domestic and international visitors two varieties of luxury villas for rent in Samui – our 2 and 3 bedroom <b>Garden Villas</b>, along with our 4 and 5 bedroom <b>Seaview Villas</b>, all of which are located in the one gated community with 24-hour security, and a short two-minute stroll from Choeng Mon beach, one of the most beautiful beaches on Samui and home to a fantastic selection of Thai and Western restaurants.</p>
  135. <p>The features these exclusive villas offer are nothing shy of amazing, <b>with each villa featuring its own private swimming pool, terraced entertaining area, and sculptured gardens</b> that are perfect for relaxing and taking in the views. Combined with open-plan living and dining areas, these Samui villa rentals are understandably in high demand, so get in touch with Horizon Homes today to avoid missing out.</p>
  136. </div>
  137. <?php } else { ?>
  138. <div class="after-copy">
  139. <h1>Koh Samui Property for Sale</h1>
  140. <p>Horizon Homes, a leading Koh Samui real estate company operating to the highest of international standards, offers homebuyers and property investors looking for fantastic property buying opportunities, an exciting collection of luxurious <strong>Koh Samui villas for sale</strong> at remarkable prices. </p>
  141. <p>If you’re looking for a sensational opportunity to buy a villa on tropical Koh Samui’s stunning north coast at Chong Moen, then our collection of meticulously designed and constructed luxury villas are sure to prove exactly what you have in mind. </p>
  142. <h2>Horizon Homes </h2>
  143. <p>We have worked hard to establish our enviable position and reputation as a real estate company known locally and abroad for its expertise and professionalism. We understand that buying or investing in property overseas often appears a daunting process for many people, and consequently, we have placed great emphasis on assuaging any fears you may have about buying or investing in <strong>property on Koh Samui</strong>, one of the most popular of all the stunning tropical islands in the Thai south. </p>
  144. <p>To provide you with peace of mind when buying <strong>Koh Samui villas</strong>, we draw upon our strong experience in Thailand and our unparalleled market knowledge to help you find the right investment opportunity that suits your specific requirements, one which assures you excellent returns on investment. </p>
  145. <h2>Lucrative Investment Opportunities</h2>
  146. <p>Securing a lucrative investment on this internationally-renowned island paradise is easy with Horizon Homes, as we can guide you towards the best <strong>properties on Koh Samui</strong>, and we offer you all the services required to complete the process in an easy and hassle-free manner. </p>
  147. <p>We monitor every phase of the construction process, and we’ll even email you pictures of the construction progress on a monthly basis so you can keep up to date with all the developments. Contact Horizon Homes for the very best in <strong>Koh Samui property</strong>.</p>
  148. </div>
  149. <?php } ?>
  150. </div>
  151. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement