PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 1.4.62 All 260 releases
propertyhive / templates / content-property.php

content-property.php in Property Hive 2.3.0, at templates/content-property.php

82 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for displaying a single property within search results loops.
4 *
5 * Override this template by copying it to yourtheme/propertyhive/content-property.php
6 *
7 * @author PropertyHive
8 * @package PropertyHive/Templates
9 * @version 1.0.0
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
14 global $property, $propertyhive_loop;
15
16 // Store loop count we're currently on
17 if ( empty( $propertyhive_loop['loop'] ) )
18 $propertyhive_loop['loop'] = 0;
19
20 // Store column count for displaying the grid
21 if ( empty( $propertyhive_loop['columns'] ) )
22 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Existing public Property Hive extension hook loop_search_results_columns; changing the established name would detach installed callbacks.
23 $propertyhive_loop['columns'] = apply_filters( 'loop_search_results_columns', 1 );
24
25 // Ensure visibility
26 if ( ! $property )
27 return;
28
29 // Increase loop count
30 ++$propertyhive_loop['loop'];
31
32 // Extra post classes
33 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone.
34 $classes = array('clear');
35 if ( 0 == ( $propertyhive_loop['loop'] - 1 ) % $propertyhive_loop['columns'] || 1 == $propertyhive_loop['columns'] )
36 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone.
37 $classes[] = 'first';
38 if ( 0 == $propertyhive_loop['loop'] % $propertyhive_loop['columns'] )
39 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone.
40 $classes[] = 'last';
41 if ( $property->featured == 'yes' )
42 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone.
43 $classes[] = 'featured';
44 ?>
45 <li <?php post_class( $classes ); ?>>
46
47 <?php do_action( 'propertyhive_before_search_results_loop_item' ); ?>
48
49 <div class="thumbnail">
50 <a href="<?php the_permalink(); ?>">
51 <?php
52 /**
53 * propertyhive_before_search_results_loop_item_title hook
54 *
55 * @hooked propertyhive_template_loop_property_thumbnail - 10
56 */
57 do_action( 'propertyhive_before_search_results_loop_item_title' );
58 ?>
59 </a>
60 </div>
61
62 <div class="details">
63
64 <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
65
66 <?php
67 /**
68 * propertyhive_after_search_results_loop_item_title hook
69 *
70 * @hooked propertyhive_template_loop_floor_area - 5 (commercial only)
71 * @hooked propertyhive_template_loop_price - 10
72 * @hooked propertyhive_template_loop_summary - 20
73 * @hooked propertyhive_template_loop_actions - 30
74 */
75 do_action( 'propertyhive_after_search_results_loop_item_title' );
76 ?>
77
78 </div>
79
80 <?php do_action( 'propertyhive_after_search_results_loop_item' ); ?>
81
82 </li>