Advertisement
Guest User

wordpress help watson

a guest
Mar 10th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.30 KB | None | 0 0
  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)); ?>
  28.  
  29.             <span class="hideSmall">
  30. <div id="postNav">
  31.     <div id="postNavLeft" style="float: left;">
  32.         <a href="#"><span class="filterButton navButton">FILTER BY:</span></a>
  33.         <a href="#"><span class="sortButton navButton">SORT BY:</span></a>
  34.     </div>
  35.     <div id="postNavRight" style="float: right;">
  36.         <?php posts_nav_link('separator','EARLIER','LATER'); ?>
  37.     </div>
  38. </div>
  39.             </span>
  40.             <?php while ( have_posts() ) : the_post(); ?>
  41.                 <?php if ( has_post_thumbnail() ) : ?>
  42.                     <div id="homeImage">
  43.                         <a href="<?php the_permalink() ?>"><?php the_post_thumbnail(); ?></a>
  44.                     </div>
  45.             <?php endif; ?>
  46.                     <div id="homeLabel">
  47.                         <h3  class="eventName"><?php the_time('l, F jS') ?>&nbsp;&nbsp;&nbsp;<?php the_category(', '); ?></h3><br />
  48.                         <h2 class="eventName"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
  49.                     </div>
  50.             <?php endwhile; // end of the loop. ?>
  51.         </div>
  52.     </div>
  53.  
  54. <?php get_footer(); ?>
  55.  
  56. <?php
  57.  function filter_where($where = '') {
  58.    $where .= " AND post_date >= DATE( NOW() )";
  59.     return $where;
  60.   }
  61.     add_filter('posts_where', 'filter_where');
  62.     $my_query = new WP_Query(
  63.         array(
  64.             'post_type'=>'post',
  65.             'posts_per_page' => 6,
  66.             //'orderby' => 'date',
  67.             'order' => 'ASC',
  68.             'cat' => 5,
  69.             'post_status' => 'publish,future',
  70.             )
  71.         );
  72.     while ( $my_query->have_posts() ) :
  73.         $my_query->the_post();
  74.         $do_not_duplicate = $post->ID;
  75. ?>
  76.         <li><a href="<?php the_permalink() ?>"><?php the_date( 'n/d'); ?> <?php the_title(); ?></a></li>
  77. <?php
  78.     endwhile;
  79.     remove_filter('posts_where', 'filter_where');
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement