author | ymh <ymh.work@gmail.com> |
Thu, 07 Nov 2013 00:08:07 +0000 | |
changeset 1 | f6eb5a861d2f |
parent 0 | d970ebf37754 |
permissions | -rwxr-xr-x |
0 | 1 |
<?php get_header(); ?> |
2 |
<?php |
|
3 |
$args=array( |
|
4 |
'post_type' => 'page', |
|
5 |
'order' => 'ASC', |
|
6 |
'orderby' => 'menu_order', |
|
7 |
'posts_per_page' => '-1' |
|
8 |
); |
|
9 |
$main_query = new WP_Query($args); |
|
10 |
$page_number=0; |
|
11 |
/*if( have_posts() ) : */ |
|
12 |
while ($main_query->have_posts()) : $main_query->the_post(); |
|
13 |
||
14 |
global $post; |
|
15 |
||
16 |
$post_name = $post->post_name; |
|
17 |
||
18 |
$title = $post->post_title; |
|
19 |
||
20 |
$post_id = get_the_ID(); |
|
21 |
||
22 |
$content = get_the_content(); |
|
23 |
||
24 |
$show_page_in_menu = get_post_meta($post_id , 'show_page_in_menu' , true); |
|
25 |
||
26 |
$pageTemplate= get_post_meta($post_id , 'page_template' , true); |
|
27 |
||
28 |
$shortDesc = get_post_meta($post_id , 'short_desc' , true); |
|
29 |
||
30 |
$page_number++; |
|
31 |
$first_class=''; |
|
32 |
if($page_number == 1) { |
|
33 |
$first_class=' firstPage'; |
|
34 |
} |
|
35 |
||
36 |
if ($show_page_in_menu == 'Yes') |
|
37 |
{ |
|
38 |
||
39 |
if ($pageTemplate == 'Home') |
|
40 |
{ |
|
41 |
?> |
|
42 |
|
|
43 |
<div id="<?php echo $post_name; ?>" class="sectionWrapper <?php echo $first_class; ?>" ><!-- start section --> |
|
44 |
<?php |
|
45 |
if($page_number == 1) { |
|
46 |
topHeaderDisplay(); |
|
47 |
echo '<div class="clearfix"></div>'; |
|
48 |
} |
|
49 |
?> |
|
50 |
|
|
51 |
<?php menu($page_number); ?> |
|
52 |
<div class="clearfix"></div> |
|
53 |
|
|
54 |
<!-- slider --> |
|
55 |
<?php |
|
56 |
||
57 |
if ( function_exists( 'get_option_tree' ) ) { |
|
58 |
if (get_option_tree( 'display_home_page_slider') == 'Yes' ){ |
|
59 |
if (get_option_tree( 'nivo_slider')) { |
|
60 |
$slides = get_option_tree( 'nivo_slider', $option_tree, false, true, -1 ); |
|
61 |
$img_num = 1; |
|
62 |
if(!empty($slides)){ ?> |
|
63 |
<div id="slides"> |
|
64 |
<div class="slides_container"> |
|
65 |
<?php |
|
66 |
foreach( $slides as $slide ) { |
|
67 |
echo '<div class="slide">'; |
|
68 |
echo '<a href="'.$slide['link'].'"><img src="'.$slide['image'].'" title="" alt="" /></a>'; |
|
69 |
if (($slide['title'] != '')||($slide['description'] != '')) { |
|
70 |
echo '<div class="caption">'; |
|
71 |
echo '<div class="text1">'.$slide['title'].'</div>'; |
|
72 |
echo '<div class="text2">'.$slide['description'].'</div>'; |
|
73 |
echo '</div>'; |
|
74 |
} |
|
75 |
echo '</div>'; |
|
76 |
$img_num++; |
|
77 |
} |
|
78 |
echo '</div></div>'; |
|
79 |
} }}} |
|
80 |
||
81 |
?> |
|
82 |
|
|
83 |
|
|
84 |
<!-- quote --> |
|
85 |
<?php |
|
86 |
$home_page_quote_title=''; |
|
87 |
$home_page_quote_content=''; |
|
88 |
||
89 |
if ( function_exists( 'get_option_tree') ){ |
|
90 |
if( get_option_tree( 'home_page_quote_title') ) { |
|
91 |
$home_page_quote_title = get_option_tree( 'home_page_quote_title' ); |
|
92 |
||
93 |
} |
|
94 |
if( get_option_tree( 'home_page_quote_content') ) { |
|
95 |
$home_page_quote_content = get_option_tree( 'home_page_quote_content' ); |
|
96 |
||
97 |
} |
|
98 |
||
99 |
if( get_option_tree( 'display_home_page_quote') == 'Yes' ) { |
|
100 |
echo '<div class="quote">'; |
|
101 |
echo '<h1>'.$home_page_quote_title.'</h1>'; |
|
102 |
echo '<p>'.$home_page_quote_content.'</p>'; |
|
103 |
echo '</div>'; |
|
104 |
} |
|
105 |
} |
|
106 |
?> |
|
107 |
||
108 |
<?php if ( function_exists( 'get_option_tree' ) ) { |
|
109 |
if (get_option_tree( 'display_home_page_circle_columns') == 'Yes' ){ |
|
110 |
if (get_option_tree( 'circle_columns')) { |
|
111 |
$columns = get_option_tree( 'circle_columns', $option_tree, false, true, -1 ); |
|
112 |
$col_num = 0; |
|
113 |
if(!empty($columns)){ ?> |
|
114 |
<div id="circles"><!-- start circles --> |
|
115 |
<ul id="sti-menu" class="sti-menu"> |
|
116 |
|
|
117 |
<?php |
|
118 |
foreach( $columns as $columns ) { |
|
119 |
echo '<li data-hovercolor="#e4e3e3">'; |
|
120 |
echo '<a href="'.$columns['link'].'">'; |
|
121 |
echo '<h2 data-type="mText" class="sti-item">'.$columns['title'].'</h2>'; |
|
122 |
echo '<p data-type="sText" class="sti-item">'.$columns['description'].'</p>'; |
|
123 |
echo '<span data-type="icon" class="sti-icon sti-icon-circle1 sti-item" style="background-image:url('.$columns['image'].');"></span>'; |
|
124 |
echo '</a></li>'; |
|
125 |
} |
|
126 |
echo '</ul></div>'; |
|
127 |
} }}} |
|
128 |
||
129 |
?> |
|
130 |
||
131 |
</div><!-- end section --> |
|
132 |
<div class="clearfix"></div> |
|
133 |
<div class="h250"></div> |
|
134 |
<?php |
|
135 |
} //end if home |
|
136 |
else |
|
137 |
||
138 |
if ($pageTemplate == 'Portfolio') |
|
139 |
{ |
|
140 |
?> |
|
141 |
|
|
142 |
<div id="<?php echo $post_name; ?>" class="sectionWrapper <?php echo $first_class; ?> mh500"><!-- start section --> |
|
143 |
<?php |
|
144 |
if($page_number == 1) { |
|
145 |
topHeaderDisplay(); |
|
146 |
echo '<div class="clearfix"></div>'; |
|
147 |
} |
|
148 |
?> |
|
149 |
<?php menu($page_number); ?> |
|
150 |
<?php |
|
151 |
echo '<div class="page-title">'; |
|
152 |
echo '<h2 class="titleH2">'.$title.'</h2>'; |
|
153 |
if (!empty($shortDesc)) { |
|
154 |
echo '<span class="shortDesc11">}</span><p class="shortDesc12">'.$shortDesc.'</p>'; |
|
155 |
} |
|
156 |
echo '</div>'; |
|
157 |
||
158 |
?> |
|
159 |
<div id="eden"> |
|
160 |
</div> |
|
161 |
<div id="vsi"> |
|
162 |
<?php |
|
163 |
||
164 |
echo '<div id="portfolio-content" data-name="portfolio-content">'; |
|
165 |
||
166 |
echo '<div id="portfolio-filter">'; |
|
167 |
echo '<div class="line-filter"></div>'; |
|
168 |
echo '<ul id="filterOptions">'; |
|
169 |
echo '<li class="active"><a href="#" data-name="all" class="all">All</a></li>'; |
|
170 |
$terms = get_terms("portfolio_categories"); |
|
171 |
$count = count($terms); |
|
172 |
if ( $count > 0 ){ |
|
173 |
||
174 |
foreach ( $terms as $term ) { |
|
175 |
echo '<li class="dot"><span></span></li><li ><a href="#" data-name="'.$term->slug.'" class="'.$term->slug.'">'.$term->name.'</a></li>'; |
|
176 |
||
177 |
} |
|
178 |
} |
|
179 |
echo '</ul><div class="clearfix"></div><div class="line-filter"></div></div><div class="clearfix"></div>'; |
|
180 |
||
181 |
||
182 |
$args = array('post_type'=> 'portfolio', 'posts_per_page' => -1, 'order'=> 'DESC', 'orderby' => 'post_date' ); |
|
183 |
$posts = get_posts($args); |
|
184 |
$idd=0; |
|
185 |
if($posts) { |
|
186 |
||
187 |
echo '<ul id="thumbs" class="portfolio-circles" class="mb450">'; |
|
188 |
$itemCount = 0; |
|
189 |
foreach($posts as $post) |
|
190 |
{ |
|
191 |
$termlist=""; |
|
192 |
$itemClass=''; |
|
193 |
setup_postdata($post); |
|
194 |
$idd++; |
|
195 |
||
196 |
$terms = get_the_terms( $post->ID, 'portfolio_categories' ); |
|
197 |
$term_list = ''; |
|
198 |
if( is_array($terms) ) { |
|
199 |
foreach( $terms as $term ) { |
|
200 |
$term_list .= $term->slug; |
|
201 |
$term_list .= ' '; |
|
202 |
} |
|
203 |
} |
|
204 |
$itemCount++; |
|
205 |
if(($itemCount % 5) == 0) { |
|
206 |
$itemClass='class="last"'; |
|
207 |
} |
|
208 |
else { |
|
209 |
$itemClass=''; |
|
210 |
} |
|
211 |
||
212 |
||
213 |
$link=get_permalink(); |
|
214 |
||
215 |
?> |
|
216 |
|
|
217 |
<li |
|
218 |
<?php echo $itemClass ?> data-id="id-<?php echo $idd; ?>" data-type="<?php echo $term_list; ?>" > |
|
219 |
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?> |
|
220 |
|
|
221 |
<a onclick="return showPortfolioItem('<?php echo $link; ?>', '<?php echo $post_name; ?>');" href="#" class="view"><div class="circle-p1 <?php echo $term_list; ?> all"><img src="<?php echo get_template_directory_uri(); ?>/images/lines-hover-circle-portfolio.png" alt="" /></div></a> |
|
222 |
|
|
1
f6eb5a861d2f
remove unnessary files. Make timthumb work
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
223 |
<a onclick="return showPortfolioItem('<?php echo $link; ?>', '<?php echo $post_name; ?>');" href="#" class="view"><div class="circle-p <?php echo $term_list; ?> all" style="background-image: url(<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo get_image_path($image[0]); ?>&h=160&w=160&zc=1);"> </div></a> |
0 | 224 |
<a onclick="return showPortfolioItem('<?php echo $link; ?>', '<?php echo $post_name; ?>');" href="#" class="view"><p class="w160"><?php the_title(); ?></p></a> |
225 |
|
|
226 |
</li> |
|
227 |
|
|
228 |
|
|
229 |
|
|
230 |
<?php |
|
231 |
} //end foreach |
|
232 |
echo '</ul>'; |
|
233 |
} //end if($posts) |
|
234 |
?> |
|
235 |
</div> <!--end portfolio content --> |
|
236 |
</div> |
|
237 |
</div><!-- end PORTFOLIO section --> |
|
238 |
<div class="clearfix"></div> |
|
239 |
<div class="h260"></div> |
|
240 |
<?php |
|
241 |
} |
|
242 |
else |
|
243 |
if ($pageTemplate == 'Contact') |
|
244 |
{ |
|
245 |
||
246 |
$input_one_title = 'Name: '; |
|
247 |
$input_two_title = 'Email Address: '; |
|
248 |
$textarea_title = 'Message: '; |
|
249 |
$input_one_prevalue = 'John Doe'; |
|
250 |
$input_two_prevalue = 'john.doe@domain.com'; |
|
251 |
$textarea_prevalue = 'We will appreciate your critics and your good words..'; |
|
252 |
$required_message_indicator = ' indicates a required field'; |
|
253 |
$send_success = 'Thank you!<br /> Your email has been delivered. We will contact you ASAP. <br /><br /><img src="http://trendis.si/wp-themes/amazing-studio/wp-content/uploads/2012/02/logo.png" alt="" />'; |
|
254 |
$send_unsuccess = 'Error submitting the form'; |
|
255 |
$required_message = 'This is a required field.'; |
|
256 |
$invalid_email_message = 'Sorry! You have entered an invalid E-mail.'; |
|
257 |
$button_text = 'Send!'; |
|
258 |
||
259 |
if ( function_exists( 'get_option_tree') ){ |
|
260 |
if( get_option_tree( 'input_one_title') ) { |
|
261 |
$input_one_title = get_option_tree( 'input_one_title' ); |
|
262 |
||
263 |
} |
|
264 |
if( get_option_tree( 'input_two_title') ) { |
|
265 |
$input_two_title = get_option_tree( 'input_two_title' ); |
|
266 |
||
267 |
} |
|
268 |
if( get_option_tree( 'textarea_title') ) { |
|
269 |
$textarea_title = get_option_tree( 'textarea_title' ); |
|
270 |
||
271 |
} |
|
272 |
if( get_option_tree( 'input_one_prevalue') ) { |
|
273 |
$input_one_prevalue = get_option_tree( 'input_one_prevalue' ); |
|
274 |
||
275 |
} |
|
276 |
if( get_option_tree( 'input_two_prevalue') ) { |
|
277 |
$input_two_prevalue = get_option_tree( 'input_two_prevalue' ); |
|
278 |
||
279 |
} |
|
280 |
if( get_option_tree( 'textarea_prevalue') ) { |
|
281 |
$textarea_prevalue = get_option_tree( 'textarea_prevalue' ); |
|
282 |
||
283 |
} |
|
284 |
if( get_option_tree( 'required_message_indicator') ) { |
|
285 |
$required_message_indicator = get_option_tree( 'required_message_indicator' ); |
|
286 |
||
287 |
} |
|
288 |
if( get_option_tree( 'send_success') ) { |
|
289 |
$send_success = get_option_tree( 'send_success' ); |
|
290 |
||
291 |
} |
|
292 |
if( get_option_tree( 'send_unsuccess') ) { |
|
293 |
$send_unsuccess = get_option_tree( 'send_unsuccess' ); |
|
294 |
||
295 |
} |
|
296 |
if( get_option_tree( 'required_message') ) { |
|
297 |
$required_message = get_option_tree( 'required_message' ); |
|
298 |
||
299 |
} |
|
300 |
if( get_option_tree( 'invalid_email_message') ) { |
|
301 |
$invalid_email_message = get_option_tree( 'invalid_email_message' ); |
|
302 |
||
303 |
} |
|
304 |
if( get_option_tree( 'button_text') ) { |
|
305 |
$button_text = get_option_tree( 'button_text' ); |
|
306 |
||
307 |
} |
|
308 |
} |
|
309 |
?> |
|
310 |
<div id="<?php echo $post_name; ?>" class="sectionWrapper <?php echo $first_class; ?>" ><!-- start section --> |
|
311 |
<?php |
|
312 |
if($page_number == 1) { |
|
313 |
topHeaderDisplay(); |
|
314 |
echo '<div class="clearfix"></div>'; |
|
315 |
} |
|
316 |
?> |
|
317 |
<?php menu($page_number); ?> |
|
318 |
<?php |
|
319 |
echo '<div class="page-title">'; |
|
320 |
echo '<h2 class="titleH2">'.$title.'</h2>'; |
|
321 |
if (!empty($shortDesc)) { |
|
322 |
echo '<span class="shortDesc11">}</span><p class="shortDesc12">'.$shortDesc.'</p>'; |
|
323 |
} |
|
324 |
echo '</div>'; ?> |
|
325 |
<div id="map_canvas" class="mapStyleClass"></div> |
|
326 |
|
|
327 |
<div id="contact-form" class="clearfix fl"> |
|
328 |
<?php |
|
329 |
$contact_title='Fill out our contact form below to get in touch with us!'; |
|
330 |
if ( function_exists( 'get_option_tree') ){ |
|
331 |
if( get_option_tree( 'contact_title') ) { |
|
332 |
$contact_title = get_option_tree( 'contact_title' ); |
|
333 |
||
334 |
} |
|
335 |
} |
|
336 |
?> |
|
337 |
<h3><?php echo $contact_title; ?></h3> |
|
338 |
|
|
339 |
<?php if(isset($emailSent) && $emailSent == true) { ?> |
|
340 |
<p class="info">Your email was sent. Huzzah!</p> |
|
341 |
<?php } else { ?> |
|
342 |
<?php if(isset($hasError) || isset($captchaError) ) { ?> |
|
343 |
<p class="alert"><?php echo $send_unsuccess; ?></p> |
|
344 |
<?php } ?> |
|
345 |
<?php } ?> |
|
346 |
|
|
347 |
<?php |
|
348 |
$nameError=''; |
|
349 |
$emailError=''; |
|
350 |
$commentError=''; |
|
351 |
?> |
|
352 |
|
|
353 |
<form id="contact-form1" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> |
|
354 |
<div class="fl mr30 mb20"> |
|
355 |
<label for="contactName"><?php echo $input_one_title; ?><span class="required">*</span></label> |
|
356 |
<input type="text" name="contactName" id="contactName" value="<?php if(isset($_POST['contactName'])) echo $_POST['contactName'];?>" class="txt requiredField" placeholder="<?php echo $input_one_prevalue; ?>" /> |
|
357 |
<?php if($nameError != '') { ?> |
|
358 |
<br /><p class="error"><?php echo $nameError;?></p> |
|
359 |
<?php } ?> |
|
360 |
</div> |
|
361 |
|
|
362 |
|
|
363 |
<div class="fl mb20"> |
|
364 |
<label for="email"><?php echo $input_two_title; ?><span class="required">*</span></label> |
|
365 |
<input type="text" name="email" id="email" value="<?php if(isset($_POST['email'])) echo $_POST['email'];?>" class="txt requiredField email" placeholder="<?php echo $input_two_prevalue; ?>" /> |
|
366 |
<?php if($emailError != '') { ?> |
|
367 |
<br /><p class="error"><?php echo $emailError;?></p> |
|
368 |
<?php } ?> |
|
369 |
</div> |
|
370 |
|
|
371 |
<div class="fl"> |
|
372 |
<label for="commentsText"><?php echo $textarea_title; ?><span class="required">*</span></label> |
|
373 |
<textarea name="comments" id="commentsText" class="txtarea requiredField" placeholder="<?php echo $textarea_prevalue; ?>"><?php if(isset($_POST['comments'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['comments']); } else { echo $_POST['comments']; } } ?></textarea> |
|
374 |
<?php if($commentError != '') { ?> |
|
375 |
<br /><p class="error"><?php echo $commentError;?></p> |
|
376 |
<?php } ?> |
|
377 |
</div> |
|
378 |
|
|
379 |
<input type="submit" value="<?php echo $button_text; ?>" id="submit-button" name="submit" /> |
|
380 |
<input type="hidden" name="submitted" id="submitted" value="true" /> |
|
381 |
<p id="req-field-desc"><span class="required">*</span> <?php echo $required_message_indicator; ?></p> |
|
382 |
</form> |
|
383 |
</div> |
|
384 |
<?php |
|
385 |
$messageAfterSend=''; |
|
386 |
if ( function_exists( 'get_option_tree') ) { |
|
387 |
if( get_option_tree( 'message_send') ) { |
|
388 |
$messageAfterSend = get_option_tree( 'message_send' ); |
|
389 |
} |
|
390 |
} |
|
391 |
?> |
|
392 |
<script type="text/javascript"> |
|
393 |
<!--//--><![CDATA[//><!-- |
|
394 |
jQuery(document).ready(function($) { |
|
395 |
jQuery('form#contact-form1').submit(function() { |
|
396 |
jQuery('form#contact-form1 .error').remove(); |
|
397 |
var hasError = false; |
|
398 |
jQuery('.requiredField').each(function() { |
|
399 |
if($.trim(jQuery(this).val()) == '') { |
|
400 |
var labelText = $(this).prev('label').text(); |
|
401 |
jQuery(this).parent().append('<p class="error"><?php echo $required_message; ?></p>'); |
|
402 |
jQuery(this).addClass('inputError'); |
|
403 |
hasError = true; |
|
404 |
} else if(jQuery(this).hasClass('email')) { |
|
405 |
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; |
|
406 |
if(!emailReg.test($.trim(jQuery(this).val()))) { |
|
407 |
var labelText = jQuery(this).prev('label').text(); |
|
408 |
jQuery(this).parent().append('<p class="error"><?php echo $invalid_email_message; ?></p>'); |
|
409 |
jQuery(this).addClass('inputError'); |
|
410 |
hasError = true; |
|
411 |
} |
|
412 |
} |
|
413 |
}); |
|
414 |
if(!hasError) { |
|
415 |
var formInput = jQuery(this).serialize(); |
|
416 |
$.post(jQuery(this).attr('action'),formInput, function(data){ |
|
417 |
jQuery('form#contact-form1').slideUp("fast", function() { |
|
418 |
jQuery(this).before('<p class="tick"><?php echo $send_success; ?></p>'); |
|
419 |
}); |
|
420 |
}); |
|
421 |
} |
|
422 |
return false; |
|
423 |
}); |
|
424 |
}); |
|
425 |
//-->!]]> |
|
426 |
</script> |
|
427 |
<div class="contact-col-300 last fl"> |
|
428 |
<?php |
|
429 |
$right_col_title='Who we are..'; |
|
430 |
if ( function_exists( 'get_option_tree') ){ |
|
431 |
if( get_option_tree( 'right_col_title') ) { |
|
432 |
$right_col_title = get_option_tree( 'right_col_title' ); |
|
433 |
||
434 |
} |
|
435 |
} |
|
436 |
?> |
|
437 |
<h3><?php echo $right_col_title; ?></h3> |
|
438 |
<p class="contact-paragraph"> |
|
439 |
<?php |
|
440 |
if ( function_exists( 'get_option_tree') ) { |
|
441 |
if( get_option_tree( 'contact_info') ) { |
|
442 |
$contact_info = get_option_tree( 'contact_info' ); |
|
443 |
echo $contact_info; |
|
444 |
} |
|
445 |
} |
|
446 |
?> |
|
447 |
<?php |
|
448 |
if ( function_exists( 'get_option_tree') ) { |
|
449 |
if( get_option_tree( 'contact_page_email') ) { |
|
450 |
$contact_page_email = get_option_tree( 'contact_page_email' ); |
|
451 |
?> |
|
452 |
<strong>E:</strong> <a href="mailto:<?php echo $contact_page_email; ?>"><?php echo $contact_page_email; ?></a><br /><br /> |
|
453 |
||
454 |
<?php |
|
455 |
} |
|
456 |
} |
|
457 |
?> |
|
458 |
</p> |
|
459 |
<p class="contact-paragraph-call"> |
|
460 |
<?php |
|
461 |
if ( function_exists( 'get_option_tree') ) { |
|
462 |
if( get_option_tree( 'call_info') ) { |
|
463 |
$call_info = get_option_tree( 'call_info' ); |
|
464 |
echo $call_info; |
|
465 |
} |
|
466 |
} |
|
467 |
?> |
|
468 |
</p> |
|
469 |
</div> |
|
470 |
</div><!-- end CONTACT page --> |
|
471 |
<div class="h400"></div> |
|
472 |
|
|
473 |
<?php |
|
474 |
} |
|
475 |
else |
|
476 |
if ($pageTemplate == 'Blog') |
|
477 |
{ |
|
478 |
?> |
|
479 |
<div id="<?php echo $post_name; ?>" class="sectionWrapper <?php echo $first_class; ?> mh500"><!-- start section --> |
|
480 |
<?php |
|
481 |
if($page_number == 1) { |
|
482 |
topHeaderDisplay(); |
|
483 |
echo '<div class="clearfix"></div>'; |
|
484 |
} |
|
485 |
?> |
|
486 |
<?php menu($page_number); ?> |
|
487 |
<?php |
|
488 |
echo '<div class="page-title">'; |
|
489 |
echo '<h2 class="titleH2">'.$title.'</h2>'; |
|
490 |
if (!empty($shortDesc)) { |
|
491 |
echo '<span class="shortDesc11">}</span><p class="shortDesc12">'.$shortDesc.'</p>'; |
|
492 |
} |
|
493 |
echo '</div>'; |
|
494 |
||
495 |
$args = array('post_type'=> 'post', 'posts_per_page' => -1, 'order'=> 'DESC', 'orderby' => 'post_date' ); |
|
496 |
$posts = get_posts($args); |
|
497 |
$idd=0; |
|
498 |
if($posts) { |
|
499 |
$itemCount = 0; |
|
500 |
echo '<div class="blog-template">'; |
|
501 |
foreach($posts as $post) |
|
502 |
{ |
|
503 |
$termlist=""; |
|
504 |
setup_postdata($post); |
|
505 |
$idd++; |
|
506 |
$publish=true; |
|
507 |
$postType = get_post_meta($post->ID, 'post_type_selected' , true); |
|
508 |
if($postType == 'News'){$publish=false;} |
|
509 |
||
510 |
$terms = get_the_category($post->ID); |
|
511 |
$term_list = ''; |
|
512 |
||
513 |
if( is_array($terms) ) { |
|
514 |
foreach( $terms as $term ) { |
|
515 |
// if($term->cat_name == 'News'){$publish=false;} |
|
516 |
$term_list .= $term->cat_name; |
|
517 |
$term_list .= ' '; |
|
518 |
} |
|
519 |
} |
|
520 |
if($publish==true) |
|
521 |
{ |
|
522 |
$itemCount++; |
|
523 |
if(($itemCount % 2) == 0) { |
|
524 |
$itemClass=' last'; |
|
525 |
} |
|
526 |
else { |
|
527 |
$itemClass=''; |
|
528 |
} |
|
529 |
||
530 |
echo '<div class="post fl '.$itemClass.'">'; |
|
531 |
echo '<div class="post-date">'; |
|
532 |
echo '<p>'. get_the_time('d').' <span>'. get_the_time('M').'</span></p>'; |
|
533 |
echo '</div>'; |
|
534 |
echo '<div class="post-title">'; |
|
535 |
get_permalink(); |
|
536 |
||
537 |
?> |
|
538 |
|
|
539 |
<h3><a href="<?php the_permalink(); ?>" title=""><?php the_title(); ?></a></h3> |
|
540 |
<?php |
|
541 |
echo '</div>'; |
|
542 |
echo '<div class="post-image">'; |
|
543 |
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); |
|
544 |
?> |
|
545 |
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image[0]; ?>&h=181&w=465&zc=1" alt="" /></a> |
|
546 |
<?php |
|
547 |
echo '</div></div>'; |
|
548 |
} |
|
549 |
} |
|
550 |
echo '</div>'; |
|
551 |
} |
|
552 |
?> |
|
553 |
<div class="clearfix"></div> |
|
554 |
</div><!-- end BLOG page --> |
|
555 |
<?php |
|
556 |
} |
|
557 |
else |
|
558 |
if ($pageTemplate == 'News') |
|
559 |
{ |
|
560 |
?> |
|
561 |
|
|
562 |
<div id="<?php echo $post_name; ?>" class="sectionWrapper <?php echo $first_class; ?>" ><!-- start section --> |
|
563 |
<?php |
|
564 |
if($page_number == 1) { |
|
565 |
topHeaderDisplay(); |
|
566 |
echo '<div class="clearfix"></div>'; |
|
567 |
} |
|
568 |
?> |
|
569 |
<?php menu($page_number); ?> |
|
570 |
<?php |
|
571 |
echo '<div class="page-title">'; |
|
572 |
echo '<h2 class="titleH2">'.$title.'</h2>'; |
|
573 |
if (!empty($shortDesc)) { |
|
574 |
echo '<span class="shortDesc11">}</span><p class="shortDesc12">'.$shortDesc.'</p>'; |
|
575 |
} |
|
576 |
echo '</div>'; |
|
577 |
||
578 |
$args = array('post_type'=> 'post', 'posts_per_page' => -1, 'order'=> 'DESC', 'orderby' => 'post_date' ); |
|
579 |
$posts = get_posts($args); |
|
580 |
$idd=0; |
|
581 |
if($posts) { |
|
582 |
$itemCount = 0; |
|
583 |
$itemClass=''; |
|
584 |
echo "<div class='news'>"; |
|
585 |
foreach($posts as $post) |
|
586 |
{ |
|
587 |
$termlist=""; |
|
588 |
setup_postdata($post); |
|
589 |
$idd++; |
|
590 |
$publish=false; |
|
591 |
$postType = get_post_meta($post->ID, 'post_type_selected' , true); |
|
592 |
if($postType == 'News'){$publish=true;} |
|
593 |
||
594 |
$terms = get_the_category($post->ID); |
|
595 |
$term_list = ''; |
|
596 |
||
597 |
if( is_array($terms) ) { |
|
598 |
foreach( $terms as $term ) { |
|
599 |
// if($term->cat_name == 'News'){$publish=true;} |
|
600 |
$term_list .= $term->cat_name; |
|
601 |
$term_list .= ' '; |
|
602 |
} |
|
603 |
} |
|
604 |
if($publish==true) |
|
605 |
{ |
|
606 |
$itemCount++; |
|
607 |
//if ($itemClass== ' last') { echo '<div class="clearfix"></div><div class="line"></div>';} |
|
608 |
if(($itemCount % 3) == 0) { |
|
609 |
$itemClass=' last'; |
|
610 |
} |
|
611 |
else { |
|
612 |
$itemClass=''; |
|
613 |
} |
|
614 |
echo '<div class="col-300 fl '.$itemClass.'">'; |
|
615 |
echo '<div class="news-date fl">'; |
|
616 |
echo '<p>'. get_the_time('d').' <span>'. get_the_time('M').'</span></p>'; |
|
617 |
echo '</div>'; |
|
618 |
echo '<div class="news-content fl">'; |
|
619 |
echo '<h3>'.get_the_title().'</h3>'; |
|
620 |
$content = get_post($post->ID)->post_content; |
|
621 |
/*f (strlen($content) > 103) |
|
622 |
{ |
|
623 |
$content = substr($content,0,100).'...'; |
|
624 |
} |
|
625 |
*/ |
|
626 |
echo '<p>'.$content.'</p>'; |
|
627 |
echo '</div></div>'; |
|
628 |
||
629 |
} |
|
630 |
} |
|
631 |
echo '</div>'; |
|
632 |
} |
|
633 |
?> |
|
634 |
<div class="clearfix"></div> |
|
635 |
</div><!-- end BLOG page --> |
|
636 |
<?php |
|
637 |
} |
|
638 |
else |
|
639 |
{ |
|
640 |
||
641 |
echo '<div id="'. $post_name.'" class="sectionWrapper '. $first_class .'" >'; |
|
642 |
if($page_number == 1) { |
|
643 |
topHeaderDisplay(); |
|
644 |
echo '<div class="clearfix"></div>'; |
|
645 |
} |
|
646 |
menu($page_number); |
|
647 |
echo '<div class="page-title">'; |
|
648 |
echo '<h2 class="titleH2">'.$title.'</h2>'; |
|
649 |
if (!empty($shortDesc)) { |
|
650 |
echo '<span class="shortDesc11">}</span><p class="shortDesc12">'.$shortDesc.'</p>'; |
|
651 |
} |
|
652 |
echo '</div>'; |
|
653 |
the_content(); |
|
654 |
echo '</div>'; |
|
655 |
} |
|
656 |
?> |
|
657 |
<?php |
|
658 |
} |
|
659 |
endwhile; |
|
660 |
/* endif; */ |
|
661 |
?> |
|
662 |
||
663 |
<?php get_footer(); ?> |