forked from hakkens/davehakkens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
182 lines (172 loc) · 6.67 KB
/
home.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php /* Template Name: Home page */
get_header();
get_template_part( 'navbar' );
/*
function load_my_script(){
wp_register_script(
'my_script',
get_template_directory_uri() . '/js/jquery.sliderPro.min.js',
array( 'jquery' )
);
wp_enqueue_script( 'my_script' );
}
add_action('wp_enqueue_scripts', 'load_my_script');¡*/
?>
<link rel="stylesheet" href="<?php bloginfo( 'template_url' ); ?>/css/slider-pro.min.css"/>
<script src="<?php bloginfo( 'template_url' ); ?>/js/jquery.sliderPro.min.js"></script>
<div id="content">
<div class="slider-pro" id="my-slider">
<div class="sp-slides">
<?php
// require_once( '../../../wp-load.php' );
$numPosts = (isset($_GET['numPosts'])) ? $_GET['numPosts'] : 10;
$tag = (isset($_GET['tag'])) ? $_GET['tag'] : "";
$queryArgs = array(
'posts_per_page' => $numPosts,
'post__in' => get_option('sticky_posts'),
);
query_posts($queryArgs);
if ( have_posts() ) : while ( have_posts() ) : the_post();
$mPost = array();
$postID = get_the_ID();
if (get_post_format() == '' || get_post_format() == image){
$mPost = array(
"title" => the_title('','',false),
"url" => get_permalink($postID),
"images" => array(
"small" => get_the_post_thumbnail_url($postID, 'medium'),
"medium" => get_the_post_thumbnail_url($postID, 'medium_large'),
"large" => get_the_post_thumbnail_url($postID, 'large'),
"full" => get_the_post_thumbnail_url($postID, 'full'),
),
);
// if (get_post_format() == 'link'):
// if (get_post_format() == 'status'):
?>
<div class="sp-slide sp-selectable">
<a href="<?php echo $mPost['url'] ?>">
<img class="sp-image"
data-small="<?php echo $mPost['images']['small'] ?>"
data-medium="<?php echo $mPost['images']['medium'] ?>"
data-large="<?php echo $mPost['images']['large'] ?>"
data-src="<?php echo $mPost['images']['full'] ?>"
/>
<div class="shadow"></div>
<div class="meta">
<h1><?php echo $mPost['title'] ?></h1>
<h3>
<?php
foreach(get_the_tags() as $tag){
echo '#' . $tag->name .' ';
}
?>
</h3>
<p>Read more</p>
</div>
</a>
</div>
<?php
}elseif (get_post_format() == 'video'){
$post_meta = get_post_meta(get_the_ID());
//TODO: handle video show
continue;
if ($post_meta['_youtube_video_url'][0] != ''){
$video_url = $post_meta['_youtube_video_url'][0];
parse_str(parse_url($video_url, PHP_URL_QUERY ), $querystring);
?>
<div class="sp-slide sp-selectable">
<a class="sp-video" href=<?php echo $video_url ?>>
<img src="https://img.youtube.com/vi/<?php echo $querystring['v']?>/maxresdefault.jpg" width="100vw"/>
</a>
</div>
<?php
}elseif ($post_meta['_vimeo_video_url'][0] != ''){
$video_url = $post_meta['_vimeo_video_url'][0];
}elseif ($post_meta['_vine_video_url'][0] != ''){
$video_url = $post_meta['_vine_video_url'][0];
}elseif ($post_meta['mega_youtube_vimeo_url'][0] != ''){
$video_url = $post_meta['mega_youtube_vimeo_url'][0];
}
}
endwhile;
endif;
?>
</div>
</div>
<img id="latest" class="imgTitle" src="<?php bloginfo( 'template_url' ); ?>/img/latest.png"/>
<div id="post-filter">
<?php
global $wp;
$tag = '';
$requested = explode('/', $wp->request);
if($requested[0]=='tag'){
$tag = $requested[1];
}
?>
<ul>
<li class="all">
<a href="/" class="<?php echo $tag==''?' active':'' ?>">
<img src="<?php bloginfo( 'template_url' ); ?>/img/filters/<?php echo $tag==''?'active':'normal' ?>_03.png">
</a>
</li>
<li class="highlights">
<a href="/tag/highlight" class="<?php echo $tag=='highlight'?' active':'' ?>">
<img src="<?php bloginfo( 'template_url' ); ?>/img/filters/<?php echo $tag=='highlight'?'active':'normal' ?>_08.png">
</a>
</li>
<li class="preciousplastic">
<a href="/tag/preciousplastic" class="<?php echo $tag=='preciousplastic'?' active':'' ?>">
<img src="<?php bloginfo( 'template_url' ); ?>/img/filters/<?php echo $tag=='preciousplastic'?'active':'normal' ?>_04.png">
</a>
</li>
<li class="storyhopper">
<a href="/tag/storyhopper" class="<?php echo $tag=='storyhopper'?' active':'' ?>">
<img src="<?php bloginfo( 'template_url' ); ?>/img/filters/<?php echo $tag=='storyhopper'?'active':'normal' ?>_06.png">
</a>
</li>
<li class="phonebloks">
<a href="/tag/phonebloks" class="<?php echo $tag=='phonebloks'?' active':'' ?>">
<img src="<?php bloginfo( 'template_url' ); ?>/img/filters/<?php echo $tag=='phonebloks'?'active':'normal' ?>_05.png">
</a>
</li>
<li class="community">
<a href="/tag/community" class="<?php echo $tag=='community'?' active':'' ?>">
<img src="<?php bloginfo( 'template_url' ); ?>/img/filters/<?php echo $tag=='community'?'active':'normal' ?>_07.png">
</a>
</li>
</ul>
<?php
/* //Removed in favor of fixed menu with images
wp_nav_menu([
'container' => '',
'theme_location' => 'grid_filter'
]);
*/
?>
</div>
<div id="post-grid">
</div>
<div id="post-grid-loader" style="display:none">
<img src="<?php bloginfo( 'template_url' ); ?>/img/loading.gif">
</div>
<button id="post-grid-more" class="btn-main" type="button">More please!</button>
<div id="montlyNews">
<img src="<?php bloginfo( 'template_url' ); ?>/img/monthly.png"/>
<iframe src="https://www.youtube.com/embed/videoseries?list=PLtYgsstkMPuVdh4Y-L9RFRG1Hv3w4JC-j&modestbranding=1" frameborder="0" allowfullscreen></iframe>
</div>
<div id="mainCommunity" class="army-support">
<img id="community" class="imgTitle" src="<?php bloginfo( 'template_url' ); ?>/img/community.png"/>
<div id="communityContent">
<div id="members">
<?php
the_widget("BP_Core_Recently_Active_Widget", "title=Members&max_members=9");
// the_widget("BP_Core_Members_Widget", "title=Members2&max_members=8");
?>
</div>
<?php the_widget("Latest_Community_Uploads", "max=9"); ?>
</div>
<img id="solving" class="imgTitle" src="<?php bloginfo( 'template_url' ); ?>/img/solving.png"/>
<button class="btn-main" onclick="window.location.href='/community/army/'">Join the community</button>
</div>
</div>
<?php get_footer(); ?>