Advertisement
behance

index.php

Jul 23rd, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php $args = array(
  3.                             'posts_per_page' => 1, // We are showing only one post
  4.                             'category_name' => 'prime' // showing form category prime
  5.                             );
  6.  
  7. // Create a new filtering function that will add our where clause to the query
  8. function filter_where( $where = '' ) {
  9.     // posts published last 5 hours
  10.     $where .= " AND post_date > '" . date('Y-m-d', strtotime('+ 1 hours')) . "'";
  11.     return $where;
  12. }
  13.  
  14. add_filter( 'posts_where', 'filter_where' );
  15. $the_query = new WP_Query( $args );
  16. remove_filter( 'posts_where', 'filter_where' ); ?>
  17.  
  18.  <div id="prime_news" class="col-full">
  19.  <?php
  20.     if ($the_query->have_posts()) :?>
  21. <div id="prime_headline">
  22. <?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
  23. <?php endwhile; ?>
  24. <div class="prime_left fl">
  25. <h3><a href="<?php the_permalink(); ?>" title="" class="title_slide"><?php the_title(); ?></a></h3>
  26. <p class="prime_excerpt"><?php echo limit_words(get_the_excerpt(), '190'); ?><span  class="read-more"><a href="<?php the_permalink(); ?>"><?php _e('&#2310;&#2327;&#2375;  &#2346;&#2338;&#2375;...', 'BharatNews'); ?></a></span></p></div>
  27. <div class="prime_right fr"><?php bharti_get_image('image',560,320,' '.$GLOBALS['align']); ?></div>
  28. </div><div class="clear"></div>
  29.     <?php endif; ?>
  30.  
  31.  </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement