-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-properties-grid.php
38 lines (33 loc) · 1.03 KB
/
page-properties-grid.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Template Name: Properties Grid Template
*/
global $wp_query;
$rows = aviators_settings_get_value('properties', 'homepage', 'rows');
$cols = aviators_settings_get_value('properties', 'homepage', 'cols');
$type = aviators_settings_get_value('properties', 'homepage', 'type');
$shuffle = aviators_settings_get_value('properties', 'homepage', 'shuffle_results');
$do_shuffle = FALSE;
if ($shuffle == 'on') {
$do_shuffle = TRUE;
}
switch ($type) {
case 'reduced':
$posts = aviators_properties_get_reduced($rows * $cols, $do_shuffle);
break;
case 'featured':
$posts = aviators_properties_get_featured($rows * $cols, $do_shuffle);
break;
default:
$posts = aviators_properties_get_most_recent($rows * $cols, $do_shuffle);
break;
}
$id = get_the_ID();
$post = get_post($id);
$content = do_shortcode($post->post_content);
echo View::render('page-properties-grid.twig', array(
'wp_query' => $wp_query,
'page' => $post,
'content' => $content,
'posts' => $posts,
));