Boston International Real Estate
This project was designed by Transmyt Marketing and I worked as an in-house developer on this one. We did some pretty nice coding to accommodate the service-based needs of this website.
I am proud of how the Developments section came out. Here is the code I wrote for this the Developments template, which you can see in the code example below and here is link to the front-end result… Developments – B.I.R.E
Visit Boston International Real Estate…
<?php /* Template Name: Developments */ get_header(); ?>
<?php /*
* This Develpoments template is used to display
* developments for Boston International Real Estate.
* Real estate agents can enter development titles, descriptions,
* and photos into WordPress WooThemes Estate theme. This template displays that information
* and creates buttons that link to listings of available units within
* those developments. The links open URLs formatted according to
* the requirements of the plugin dsIDXpress, which retrieve real estate
* listings from the MLS listings service.
*
* Created by Zachary Linke for Transmyt Marketing
*/
?>
<div id="content" class="page col-full">
<?php $page_id = 138;
$development = get_page($page_id);?>
<div class="bottom-border" id="content-header">
<h1 class="flt-lft light-title title"><?php _e('Developments', 'woothemes'); ?></h1>
<a class="button flt-rgt georgia-btn" href="<?php bloginfo('url'); ?>/search-our-properties/" id="search-our-properties-btn"><?php _e('Search Our Properties','woothemes'); ?></a>
<div class="clr"></div><!-- Not really using these anymore...now using .group/.clearfix in parent container - ZL 3/11/2012 -->
</div>
<div id="developments">
<?php //Checks to see if Spanish Language or English page, assigns property type accordingly
if(ICL_LANGUAGE_CODE == 'es'){
$property_type = 'urbanizaciones';
}else{
$property_type = 'developments';
}
$count = 0;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
'propertytype'=> $property_type,
'post_type' => 'woo_estate',
'post_status' => 'publish',
'posts_per_page' => 10,
'paged'=> $paged,
'orderby'=>'modified'
);
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query($args);
/* PageNavi at Top */
if (function_exists('wp_pagenavi')){wp_pagenavi();}
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
$id = get_the_ID();// The development post id
$currentDescrip = get_the_content(); // The description of the development
//Just a custom advanced excerpt
$descripExcerpt = substr($currentDescrip, 0, 120);
$needle = ' ';
$pos = strripos($descripExcerpt, $needle);
$finalExcerpt =substr($currentDescrip, 0, $pos);
$devAddress = get_post_meta($id,'address', true);// Gets physical address of development as entered by client
//Checks for comma formatting to pass address information to appropriate variables
$addLength = strlen($devAddress);//address string length
$comma = ',';// comma = 'needle in haystack'
$commaPos = stripos($devAddress, $comma);// position of comma in address string
$streetName = substr($devAddress,0,$commaPos);// assigns street name from string to variable
$citySub = substr($devAddress, $commaPos+1);// grabs city substring from address
$commaPos2 = stripos($citySub, $comma);// finds next comma in city substring
$city = substr($citySub,1, $commaPos2-1);// assigns city name to variable
$count++;// adds to development post count
//Sets margin-right 0 with .last class for properties in right column
if($count % 2 == 0){
echo '<div class="border flt-lft development last">';
}else{
echo '<div class="border flt-lft development">';
}
// Development images, titles, and descriptions
echo '<a class="flt-lft small-img-border" href="'.get_permalink().'">'.get_the_post_thumbnail($id,array(120,120)).'</a>';
echo '<h4 class="flt-lft"><a href="'.get_permalink().'">'.get_the_title().'</a></h4>';
echo '<p class="flt-lft">'.$finalExcerpt.'...<a href="'.get_permalink().'">'.__('Learn More', 'woothemes').'</a></p>';
//passing street and city variables into buttons that link to URLS that access the real estate listings service
echo '<a class="flt-lft georgia-btn light-blue-btn rounded-corner-4px" href="'.get_bloginfo('url').'/idx/?idx-q-AddressMasks='.$streetName.'%&idx-q-Cities='.$city.'&idx-q-PropertyTypes=162">'.__('See Sales', 'woothemes').'</a> <a class="light-blue-btn flt-lft georgia-btn rounded-corner-4px" href="'.get_bloginfo('url').'/idx/?idx-q-AddressMasks='.$streetName.'%&idx-q-Cities='.$city.'&idx-q-PropertyTypes=158">'.__('See Rentals', 'woothemes').'</a> <a class="flt-lft georgia-btn dark-blue-btn rounded-corner-4px" href="'.get_bloginfo('url').'/idx/?idx-q-AddressMasks='.$streetName.'%&idx-q-Cities='.$city.'&idx-q-PropertyTypes<0>=158&idx-q-PropertyTypes<1>=162">'.__('See All', 'woothemes').'</a></div>';
endwhile;
endif;
if (function_exists('wp_pagenavi')){wp_pagenavi();}
$wp_query = null;
$wp_query = $temp;
wp_reset_query();
echo "<div class='clr'></div>";
?>
</div><!-- /#developments -->
</div><!-- /#content -->
<?php get_footer(); ?>
|