Guest User

geomywp-results.php

a guest
Nov 24th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.22 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Posts locator "grid-gray" search results template file.
  4.  *
  5.  * The information on this file will be displayed as the search results.
  6.  *
  7.  * The function pass 2 args for you to use:
  8.  * $gmw  - the form being used ( array )
  9.  * $post - each post in the loop
  10.  *
  11.  * You could but It is not recomemnded to edit this file directly as your changes will be overridden on the next update of the plugin.
  12.  * Instead you can copy-paste this template ( the "grid-gray" folder contains this file and the "css" folder )
  13.  * into the theme's or child theme's folder of your site and apply your changes from there.
  14.  *
  15.  * The template folder will need to be placed under:
  16.  * your-theme's-or-child-theme's-folder/geo-my-wp/posts/search-results/
  17.  *
  18.  * Once the template folder is in the theme's folder you will be able to choose it when editing the posts locator form.
  19.  * It will show in the "Search results" dropdown menu as "Custom: grid-gray".
  20.  */
  21. ?>
  22. <!--  Main results wrapper - wraps the paginations, map and results -->
  23. <div class="gmw-results-wrapper gmw-results-wrapper-<?php echo $gmw['ID']; ?> gmw-pt-grid-gray-results-wrapper">
  24.    
  25.     <?php do_action( 'gmw_search_results_start' , $gmw, $post ); ?>
  26.    
  27.     <!-- results count -->
  28.     <div class="results-count-wrapper">
  29.         <p><?php gmw_results_message( $gmw, false ); ?></p>
  30.     </div>
  31.    
  32.     <?php do_action( 'gmw_search_results_before_top_pagination' , $gmw, $post ); ?>
  33.    
  34.     <div class="pagination-per-page-wrapper top">
  35.         <!--  paginations -->
  36.         <?php gmw_per_page( $gmw, $gmw['total_results'], 'paged' ); ?><?php gmw_pagination( $gmw, 'paged', $gmw['max_pages'] ); ?>
  37.     </div>
  38.    
  39.      <!-- GEO my WP Map -->
  40.     <?php
  41.     if ( $gmw['search_results']['display_map'] == 'results' ) {
  42.         gmw_results_map( $gmw );
  43.     }
  44.     ?>
  45.        
  46.     <?php do_action( 'gmw_search_results_before_loop' , $gmw, $post ); ?>
  47.    
  48.     <!--  Results wrapper -->
  49.     <ul class="posts-list-wrapper">
  50.  
  51.         <?php while ( $gmw_query->have_posts() ) : $gmw_query->the_post(); ?>
  52.        
  53.             <?php $featured = ( !empty( $post->feature ) ) ? 'gmw-featured-post' : ''; ?>
  54.  
  55.             <li id="post-<?php the_ID(); ?>" <?php post_class( 'single-post '.$featured ); ?>>
  56.                
  57.                 <div class="wrapper-inner">
  58.                
  59.                     <?php do_action( 'gmw_search_results_loop_item_start' , $gmw, $post ); ?>
  60.                
  61.                     <!-- Title -->
  62.                     <div class="top-wrapper">  
  63.                         <h2 class="post-title">
  64.                             <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  65.                                 <?php the_title(); ?>
  66.                             </a>
  67.                         </h2>
  68.                         <span class="radius"><?php gmw_distance_to_location( $post, $gmw ); ?></span>
  69.                    
  70.                     </div>
  71.                                        
  72.                     <div class="post-content">
  73.                        
  74.                         <?php if ( isset( $gmw['search_results']['featured_image']['use'] ) ) { ?>
  75.                            
  76.                             <?php do_action( 'gmw_posts_loop_before_image', $gmw, $post ); ?>
  77.                                                    
  78.                             <?php if ( has_post_thumbnail() ) { ?>
  79.                                 <div class="post-thumbnail">
  80.                                     <?php the_post_thumbnail( array( $gmw['search_results']['featured_image']['width'], $gmw['search_results']['featured_image']['height'] ) ); ?>
  81.                                 </div>
  82.                             <?php } else { ?>
  83.                                 <i class="fa fa-picture-o no-post-thumbnail"></i>
  84.                             <?php } ?>
  85.                            
  86.                         <?php } ?>
  87.                        
  88.                         <!--  Excerpt -->
  89.                         <?php if ( isset( $gmw['search_results']['excerpt']['use'] ) ) { ?>
  90.                        
  91.                             <?php do_action( 'gmw_posts_loop_before_excerpt', $gmw, $post ); ?>
  92.                            
  93.                             <div class="excerpt">
  94.                                 <?php gmw_excerpt( $post, $gmw, $post->post_content, $gmw['search_results']['excerpt']['count'], $gmw['search_results']['excerpt']['more'] ); ?>
  95.                             </div>
  96.                         <?php } ?>
  97.                
  98.                         <!--  Addiotional info -->
  99.                         <?php if ( !empty( $gmw['search_results']['additional_info'] ) ) { ?>
  100.    
  101.                             <?php do_action( 'gmw_search_results_before_contact_info', $post, $gmw ); ?>
  102.                            
  103.                             <div class="contact-info">
  104.                                 <h4><?php echo $gmw['labels']['search_results']['contact_info']['contact_info']; ?></h4>
  105.                                 <?php gmw_additional_info( $post, $gmw, $gmw['search_results']['additional_info'], $gmw['labels']['search_results']['contact_info'], 'ul' ); ?>
  106.                             </div>
  107.                         <?php } ?>
  108.                            
  109.                         <?php if ( !empty( $gmw['search_results']['opening_hours'] ) ) { ?>
  110.    
  111.                             <?php do_action( 'gmw_search_results_before_opening_hours', $post, $gmw ); ?>
  112.                            
  113.                             <div class="opening-hours">
  114.                                 <?php gmw_pt_days_hours( $post, $gmw ); ?>
  115.                             </div>
  116.                         <?php } ?>
  117.                        
  118.                         <?php gmw_pt_taxonomies( $gmw, $post ); ?>
  119.  
  120.                     </div>
  121.                    
  122.                     <?php do_action( 'gmw_posts_loop_before_bottom_wrapper' , $gmw, $post ); ?>
  123.                    
  124.                     <div class="bottom-wrapper">
  125.                         <!-- Get directions -->
  126.                         <?php if ( isset( $gmw['search_results']['get_directions'] ) ) { ?>
  127.                        
  128.                             <?php do_action( 'gmw_search_results_before_get_directions', $post, $gmw ); ?>
  129.                             <!--  Address -->
  130.                             <div class="get-directions-wrapper">
  131.                                 <span class="fa fa-map-marker address-icon"></span>
  132.                                 <?php gmw_directions_link( $post, $gmw, $post->address ); ?>
  133.                             </div>
  134.                         <?php } else { ?>
  135.                              <!--  Address -->
  136.                             <div class="address-wrapper">
  137.                                 <span class="fa fa-map-marker address-icon"></span>
  138.                                 <span class="wppl-address"><?php gmw_location_address( $post, $gmw ); ?></span>
  139.                             </div>
  140.                         <?php  } ?>
  141.                        
  142.                         <!--  Driving Distance -->
  143.                         <?php if ( isset( $gmw['search_results']['by_driving'] ) ) { ?>
  144.                             <?php gmw_driving_distance( $post, $gmw, false ); ?>
  145.                         <?php } ?>
  146.                     </div>
  147.                    
  148.                     <?php do_action( 'gmw_search_results_loop_item_end', $gmw, $post ); ?>
  149.                 </div>
  150.                
  151.             </li><!-- #post -->
  152.        
  153.         <?php endwhile;  ?>
  154.     </ul>
  155.    
  156.     <?php do_action( 'gmw_search_results_after_loop' , $gmw, $post ); ?>
  157.    
  158.     <div class="pagination-per-page-wrapper bottom">
  159.         <!--  paginations -->
  160.         <?php gmw_per_page( $gmw, $gmw['total_results'], 'paged' ); ?><?php gmw_pagination( $gmw, 'paged', $gmw['max_pages'] ); ?>
  161.     </div>
  162.    
  163.     <?php do_action( 'gmw_search_results_end' , $gmw, $post ); ?>
  164.    
  165. </div> <!-- output wrapper -->
Add Comment
Please, Sign In to add comment