-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-resources.php
117 lines (114 loc) · 3.16 KB
/
page-resources.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php /* Template Name: local resources */ ?>
<?php get_header(); ?>
<div class="content-page local-resources">
<div class="pad-large"></div>
<section id="hero" class="hero">
<div class="row">
<?php
if (have_posts()):
while (have_posts()): the_post();
?>
<h1><?php the_title(); ?></h1>
<?php
endwhile;
endif;
wp_reset_query();
?>
</div>
</section>
<div class="pad-large"></div>
<section class="head">
<div class="row clearfix nav">
<h4>search</h4>
<div class="dropdown location">
<ul>
<li><a href="resource-location">All Locations</a></li>
<?php wp_list_categories('orderby=name&child_of=10&hierarchical=0&title_li='); ?>
</ul>
<span class="drop">
<i class="fa fa-angle-down"></i>
</span>
</div>
<div class="dropdown subject">
<ul>
<li><a href="resource-subject">All Subjects</a></li>
<?php wp_list_categories('orderby=name&child_of=25&hierarchical=0&title_li='); ?>
</ul>
<span class="drop">
<i class="fa fa-angle-down"></i>
</span>
</div>
</div>
<div class="row clearfix filter-info">
<h2><span class="location"></span><span class="subject"></span></h2>
</div>
</section>
<section class="body">
<div class="row clearfix list">
<ul class="clearfix" id="resource-results">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array (
'post_type' => 'local-resource',
'order' => 'ASC',
'posts_per_page' => 9,
'paged'=> $paged
);
$list_of_posts = new WP_Query( $args );
$temp_query = $wp_query;
$wp_query = NULL;
$wp_query = $list_of_posts;
if ( $list_of_posts->have_posts() ) :
while ( $list_of_posts->have_posts() ) : $list_of_posts->the_post();
?>
<li>
<div class="container">
<div class="title">
<strong><?php the_title(); ?></strong>
</div>
<div class="address">
<?php the_content() ?>
</div>
<div class="link">
<?php if(types_render_field('resource-web-site')){ ?>
<a target="_blank" href="<?php echo(types_render_field('resource-web-site',array("output"=>"raw"))); ?>">
website
<img src="<?php bloginfo('template_url'); ?>/assets/img/links-arrow-footer.png" />
</a>
<?php }; ?>
</div>
<div class="phone">
<?php if(types_render_field('resource-phone')){ ?>
<p><?php echo(types_render_field('resource-phone')); ?></p>
<?php }; ?>
</div>
<div class="gmap">
<?php if(types_render_field('resource-address')){ ?>
<a target="_blank"
href="http://maps.google.com/?q=<?php echo(types_render_field('resource-address',array("output"=>"raw"))); ?>">
Get Direction
<i class="fa fa-map-marker"></i>
</a>
<?php }; ?>
</div>
</div>
</li>
<?php
endwhile;
?>
</ul>
<div class="noresults hide">
<p>No result. Try to broaden your search..
</div>
<div class="cta clearfix">
<a class="btn primary loadmore">load more</a>
</div>
<?php
endif;
wp_reset_postdata();
?>
</div>
</section>
<div class="pad-large"></div>
</div>
<?php get_footer(); ?>