/** * Property views template * * @access public * @return void */ public static function property_views_template() { echo Realia_Template_Loader::load('statistics/property-views'); }
/** * Additional fields for logged in user * * @access public * @return void */ public static function additional_fields() { if (in_array(get_post_type(), Realia_Reviews::$allowed_post_types)) { $commenter = wp_get_current_commenter(); echo Realia_Template_Loader::load('reviews/review-field-rating', array('commenter' => $commenter)); } }
/** * Favorites * * @access public * @param $atts * @return void */ public static function favorites($atts) { if (!is_user_logged_in()) { echo Realia_Template_Loader::load('misc/not-allowed'); return; } echo Realia_Template_Loader::load('misc/favorites'); }
} ?> "> <?php dynamic_sidebar('sidebar-content-top'); ?> <?php if (have_posts()) { ?> <?php while (have_posts()) { the_post(); ?> <?php echo Realia_Template_Loader::load('content-agency'); ?> <?php } ?> <?php the_posts_pagination(array('prev_text' => __('Previous page', 'realia'), 'next_text' => __('Next page', 'realia'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'realia') . ' </span>')); ?> <?php } else { ?> <?php get_template_part('content', 'none'); ?> <?php
?> </header><!-- .page-header --> <?php /** * realia_before_agency_archive */ do_action('realia_before_agency_archive'); ?> <?php while (have_posts()) { the_post(); ?> <?php echo Realia_Template_Loader::load('agencies/row'); ?> <?php } ?> <?php /** * realia_after_agency_archive */ do_action('realia_after_agency_archive'); ?> <?php the_posts_pagination(array('prev_text' => __('Previous page', 'realia'), 'next_text' => __('Next page', 'realia'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'realia') . ' </span>')); ?>
/** * Import template * * @access public * @return void */ public static function import() { echo Realia_Template_Loader::load('misc/import'); }
?> <header class="page-header"> <?php the_archive_title('<h1 class="page-title">', '</h1>'); ?> <?php the_archive_description('<div class="taxonomy-description">', '</div>'); ?> </header><!-- .page-header --> <?php while (have_posts()) { the_post(); ?> <?php echo Realia_Template_Loader::load('properties/row'); ?> <?php } ?> <?php the_posts_pagination(array('prev_text' => __('Previous page', 'realia'), 'next_text' => __('Next page', 'realia'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'realia') . ' </span>')); ?> <?php } else { ?> <?php get_template_part('content', 'none'); ?> <?php
} ?> "> <?php dynamic_sidebar('sidebar-content-top'); ?> <?php if (have_posts()) { ?> <?php while (have_posts()) { the_post(); ?> <?php echo Realia_Template_Loader::load('content-property'); ?> <?php } ?> <?php the_posts_pagination(array('prev_text' => __('Previous page', 'realia'), 'next_text' => __('Next page', 'realia'), 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'realia') . ' </span>')); ?> <?php } else { ?> <?php get_template_part('content', 'none'); ?> <?php
/** * Catch template and render JSON output * * @access public * @return string */ public static function catch_template() { if (get_query_var('properties-feed')) { header('HTTP/1.0 200 OK'); header('Content-Type: application/json'); $property_groups = array(); $data = array(); Realia_Query::loop_properties_all(); Realia_Query::loop_properties_filter(); if (have_posts()) { while (have_posts()) { the_post(); // Property GPS positions. We will use these values // for genearating unique md5 hash for property groups. $location = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'map_location', true); $latitude = $location['latitude']; $longitude = $location['longitude']; // Build on array of property groups. We need to know how // many and which properties are at the same position. if (!empty($latitude) && !empty($longitude)) { $hash = sha1($latitude . $longitude); $property_groups[$hash][] = get_the_ID(); } } } wp_reset_query(); foreach ($property_groups as $group) { $args = array('post_type' => 'property', 'posts_per_page' => -1, 'post_status' => 'publish', 'post__in' => $group); query_posts($args); if (have_posts()) { // Group of properties at the same position so we will process // property loop inside the template. if (count($group) > 1) { $location = get_post_meta($group[0], REALIA_PROPERTY_PREFIX . 'map_location', true); $latitude = $location['latitude']; $longitude = $location['longitude']; // Marker ob_start(); $template = Realia_Template_Loader::locate('google-map-infowindow-group'); include $template; $output = ob_get_contents(); ob_end_clean(); $content = str_replace(array("\r\n", "\n", "\t"), '', $output); // Infowindow ob_start(); $template = Realia_Template_Loader::locate('google-map-marker-group'); include $template; $output = ob_get_contents(); ob_end_clean(); $marker_content = str_replace(array("\r\n", "\n", "\t"), '', $output); // Just one property. We can get current post here. } else { the_post(); $location = get_post_meta(get_the_ID(), REALIA_PROPERTY_PREFIX . 'map_location', true); $latitude = $location['latitude']; $longitude = $location['longitude']; $content = str_replace(array("\r\n", "\n", "\t"), '', Realia_Template_Loader::load('google-map-infowindow')); $marker_content = str_replace(array("\r\n", "\n", "\t"), '', Realia_Template_Loader::load('google-map-marker')); } // Array of values passed into markers[] array in jquery-google-map.js library $data[] = array('latitude' => $latitude, 'longitude' => $longitude, 'content' => $content, 'marker_content' => $marker_content); } wp_reset_query(); } echo json_encode($data); exit; } }
<?php if (!post_password_required()) { ?> <div id="reviews" class="reviews-area"> <?php comment_form(array('title_reply' => __('Post New Review', 'realia'), 'label_submit' => __('Submit Review', 'realia'), 'comment_notes_before' => false, 'comment_notes_after' => false, 'comment_field' => Realia_Template_Loader::load('reviews/review-field-comment'))); ?> <?php if (have_comments()) { ?> <h2 class="review-title"><?php echo __('User Reviews', 'realia'); ?> </h2> <ol class="review-list"> <?php wp_list_comments(array('style' => 'ol', 'short_ping' => true, 'avatar_size' => 70, 'callback' => 'Realia_Reviews::get_review_template')); ?> </ol><!-- /.comment-list --> <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) { ?> <nav id="comment-nav-below" class="navigation review-navigation" role="navigation"> <div class="nav-previous"><?php previous_comments_link(__('Older Reviews', 'realia')); ?> </div>