SHOW:
|
|
- or go back to the newest paste.
1 | <?php get_header(); ?> | |
2 | ||
3 | <!-- watson logo and ad bar --> | |
4 | <div id="adBar"> | |
5 | <div id="adBarInside"> | |
6 | <div id="adBarLogo"> | |
7 | <a href="/"><img src="/wp-content/uploads/2013/02/watson-logo.svg" /></a> | |
8 | </div> | |
9 | <div id="adBarAd"> | |
10 | <img src="/wp-content/uploads/2013/02/ad-banner.jpg" /> | |
11 | </div> | |
12 | </div> | |
13 | </div> | |
14 | ||
15 | <!-- posts --> | |
16 | <div id="mainContent"> | |
17 | <div id="contentContainer"> | |
18 | <?php | |
19 | if(isset($_GET['paged'])){ | |
20 | $page = $_GET['paged']-1; | |
21 | }else{ | |
22 | $page = 0; | |
23 | } | |
24 | $postsPerPage = 5; | |
25 | $theOffset = $page*$postsPerPage; | |
26 | ?> | |
27 | - | <?php query_posts(array('posts_per_page' => $postsPerPage, 'offset' => $theOffset, post_status => future, order => ASC)); ?> |
27 | + | |
28 | $arr_query = array('posts_per_page' => $postsPerPage, 'offset' => $theOffset, post_status => future, order => ASC); | |
29 | ||
30 | echo "<xmp>arr_query :" . __LINE__ . "\r\n"; print_r($arr_query ); echo "</xmp>"; | |
31 | ||
32 | query_posts( $arr_query ); ?> | |
33 | ||
34 | <span class="hideSmall"> | |
35 | <div id="postNav"> | |
36 | <div id="postNavLeft" style="float: left;"> | |
37 | <a href="#"><span class="filterButton navButton">FILTER BY:</span></a> | |
38 | <a href="#"><span class="sortButton navButton">SORT BY:</span></a> | |
39 | </div> | |
40 | <div id="postNavRight" style="float: right;"> | |
41 | <?php posts_nav_link('separator','EARLIER','LATER'); ?> | |
42 | </div> | |
43 | </div> | |
44 | </span> | |
45 | <?php while ( have_posts() ) : the_post(); ?> | |
46 | <?php if ( has_post_thumbnail() ) : ?> | |
47 | <div id="homeImage"> | |
48 | <a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a> | |
49 | </div> | |
50 | <?php endif; ?> | |
51 | <div id="homeLabel"> | |
52 | <h3 class="eventName"><?php the_time('l, F jS') ?> <?php the_category(', '); ?></h3><br /> | |
53 | <h2 class="eventName"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> | |
54 | </div> | |
55 | <?php endwhile; // end of the loop. ?> | |
56 | </div> | |
57 | </div> | |
58 | ||
59 | <?php get_footer(); ?> | |
60 | ||
61 | <?php | |
62 | function filter_where($where = '') { | |
63 | $where .= " AND post_date >= DATE( NOW() )"; | |
64 | return $where; | |
65 | } | |
66 | add_filter('posts_where', 'filter_where'); | |
67 | $my_query = new WP_Query( | |
68 | array( | |
69 | 'post_type'=>'post', | |
70 | 'posts_per_page' => 6, | |
71 | //'orderby' => 'date', | |
72 | 'order' => 'ASC', | |
73 | 'cat' => 5, | |
74 | 'post_status' => 'publish,future', | |
75 | ) | |
76 | ); | |
77 | while ( $my_query->have_posts() ) : | |
78 | $my_query->the_post(); | |
79 | $do_not_duplicate = $post->ID; | |
80 | ?> | |
81 | <li><a href="<?php the_permalink() ?>"><?php the_date( 'n/d'); ?> <?php the_title(); ?></a></li> | |
82 | <?php | |
83 | endwhile; | |
84 | remove_filter('posts_where', 'filter_where'); | |
85 | ?> |