Advertisement
cw17s0n

agents dropdown

Jul 5th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.19 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template Name: frontPage
  4.  */
  5.  
  6. get_header(); ?>
  7. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  8. <script type="text/javascript">
  9.            
  10.             $(document).ready(function(){
  11.                
  12.                 $('.ezjax').ezjax({
  13.                     container: '#ezjax_content',
  14.                     initial: '/login/wp-content/themes/TRTheme/searchForms/noSearch.html',
  15.                     effect: 'fade',
  16.                     <!--easing: 'easeOutBounce',-->
  17.                     bind: 'a'
  18.                 });
  19.                
  20.             });
  21.            
  22. </script>
  23.  
  24. <div class="fullWidthContent">
  25.   <h1>
  26.     <?php the_title(); ?>
  27.   </h1>
  28.   <h4>
  29.     <?php if ( function_exists('get_custom_field_value') ){
  30.         get_custom_field_value('homepageBlock1Content1', true);} ?>
  31.   </h4>
  32.   <div id="homePagePropertySearch">
  33.     <div id="homePagePropertySearchBox">
  34.       <form action="../">
  35.         <select class="ezjax">
  36.           <option value="">Choose a region</option>
  37.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchNORMLS.html">Cleveland</option>
  38.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchCINCY.html">Cincinnati</option>
  39.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchCBR.html">Columbus</option>
  40.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchDABR.html">Dayton</option>
  41.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchMBOR.html">Mansfield</option>
  42.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchNORRIS.html">Toledo</option>
  43.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchFMLS.html">Sandusky</option>
  44.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchWRIST.html">Troy</option>
  45.           <option value="/login/wp-content/themes/TRTheme/searchForms/searchWCARE.html">Lima</option>
  46.         </select>
  47.       </form>
  48.       <div id="ezjax_content">
  49.         <!-- THIS IS THE CONTAINER WHERE THE CONTENT WILL BE LOADED -->
  50.       </div>
  51.     </div>
  52.   </div>
  53.   <h4>
  54.     <?php if ( function_exists('get_custom_field_value') ){
  55.         get_custom_field_value('homepageBlock1Content2', true);} ?>
  56.   </h4>
  57.   <div id="homePageCopyBelowSearchcol1">
  58.     <p>
  59.       <?php if ( function_exists('get_custom_field_value') ){
  60.             get_custom_field_value('homepageBlock1Content3', true);} ?>
  61.     </p>
  62.   </div>
  63.   <div id="homePageCopyBelowSearchcol2">
  64.     <p>
  65.       <?php if ( function_exists('get_custom_field_value') ){
  66.             get_custom_field_value('homepageBlock1Content4', true);} ?>
  67.     </p>
  68.     <p>
  69.       <?php if ( function_exists('get_custom_field_value') ){
  70.             get_custom_field_value('homepageBlock1Content5', true);} ?>
  71.     </p>
  72.   </div>
  73.   <div id="homePageCopyBelowSearchcol3">
  74.     <p>
  75.       <?php if ( function_exists('get_custom_field_value') ){
  76.             get_custom_field_value('homepageBlock1Content6', true);} ?>
  77.     </p>
  78.   </div>
  79.   <div class="clear"></div>
  80.   <?php the_content(); ?>
  81. </div>
  82. <div id="lowerLeftContent">
  83.   <div class="leftTwoThirdsContent">
  84.     <div id="homePageMortgageRates">
  85.       <h3>mortgage rates</h3>
  86.       <?php display_mlcalc_rates(); ?>
  87.     </div>
  88.     <div id="homePagePaymentCalculator">
  89.       <h3>mortgage calculator</h3>
  90.       <?php display_mlcalc(); ?>
  91.     </div>
  92.     <div class="clear"></div>
  93.   </div>
  94.   <div class="leftTwoThirdsContent">
  95.     <div id="homePageMailingListInfo">
  96.       <p>
  97.         <?php if ( function_exists('get_custom_field_value') ){
  98.                             get_custom_field_value('homepageEmailPolicy', true);} ?>
  99.         <a href="#">Privacy Policy</a> </p>
  100.     </div>
  101.     <div id="homePageMailingListForm">
  102.       <h3>Join The Mailing List</h3>
  103.     </div>
  104.     <div class="clear"></div>
  105.   </div>
  106.   <div class="leftTwoThirdsContent">
  107.     <div class="frontPageLocations">
  108.       <h5>Cleveland</h5>
  109.       <?php if ( function_exists('get_custom_field_value') ){
  110.                         get_custom_field_value('homepageClevelandLocation', true);} ?>
  111.     </div>
  112.     <div class="frontPageLocations">
  113.       <h5>Columbus</h5>
  114.       <?php if ( function_exists('get_custom_field_value') ){
  115.                         get_custom_field_value('homepageColumbusLocation', true);} ?>
  116.     </div>
  117.     <div class="frontPageLocations">
  118.       <h5>Toledo</h5>
  119.       <?php if ( function_exists('get_custom_field_value') ){
  120.                         get_custom_field_value('homepageToledoLocation', true);} ?>
  121.     </div>
  122.     <div class="frontPageLocations">
  123.       <h5>Cincinnati</h5>
  124.       <?php if ( function_exists('get_custom_field_value') ){
  125.                         get_custom_field_value('homepageCincinnatiLocation', true);} ?>
  126.     </div>
  127.     <div class="clear"></div>
  128.   </div>
  129. </div>
  130. <div id="lowerRightContent"> <img id="frontPageAgentSearchImage" src="/login/wp-content/themes/TRTheme/images/frontPageFindAgent.jpg" />
  131.   <div class="rightOneThirdContent">
  132.     <h2>FIND AN AGENT</h2>
  133.   </div>
  134.   <div id="frontPageAgentSearchBox">
  135.     <div> <br/>
  136.       <span>By Region</span> <br/>
  137.       <?php the_dropdown_taxonomy('regions'); ?>
  138.       <?php
  139. //first get all agents
  140. $agents = new WP_Query(array('post_type' => 'agents', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'title'));
  141. //then just print out the dropdown:
  142. if ($agents->have_posts()){
  143.     echo '<select id="agents">';
  144.     while ($agents->have_posts()){
  145.         $agents-the_post();
  146.         echo '<option value="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</option>';
  147.     }
  148.     ?>
  149.       </select>
  150.       <script type="text/javascript">
  151.    
  152.         var dropdown = document.getElementById("agents");
  153.         function onCatChange() {
  154.             if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
  155.                 location.href = dropdown.options[dropdown.selectedIndex].value;
  156.             }
  157.         }
  158.         dropdown.onchange = onCatChange;
  159.    
  160.     </script>
  161.       <?php
  162. }
  163. ?>
  164.       <?php wp_reset_postdata(); ?>
  165.     </div>
  166.   </div>
  167.   <img id="frontPageBecomeAgentImage" src="/login/wp-content/themes/TRTheme/images/frontPageBecomeAgent.jpg" />
  168.   <div class="rightOneThirdContent">
  169.     <h2>BECOME AN AGENT</h2>
  170.     <p>Interested in joining?</p>
  171.   </div>
  172. </div>
  173. <div class="clear"></div>
  174. <?php endwhile; ?>
  175. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement