Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php $args = array(
- 'posts_per_page' => 1, // We are showing only one post
- 'category_name' => 'prime' // showing form category prime
- );
- // Create a new filtering function that will add our where clause to the query
- function filter_where( $where = '' ) {
- // posts published last 5 hours
- $where .= " AND post_date > '" . date('Y-m-d', strtotime('+ 1 hours')) . "'";
- return $where;
- }
- add_filter( 'posts_where', 'filter_where' );
- $the_query = new WP_Query( $args );
- remove_filter( 'posts_where', 'filter_where' ); ?>
- <div id="prime_news" class="col-full">
- <?php
- if ($the_query->have_posts()) :?>
- <div id="prime_headline">
- <?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
- <?php endwhile; ?>
- <div class="prime_left fl">
- <h3><a href="<?php the_permalink(); ?>" title="" class="title_slide"><?php the_title(); ?></a></h3>
- <p class="prime_excerpt"><?php echo limit_words(get_the_excerpt(), '190'); ?><span class="read-more"><a href="<?php the_permalink(); ?>"><?php _e('आगे पढे...', 'BharatNews'); ?></a></span></p></div>
- <div class="prime_right fr"><?php bharti_get_image('image',560,320,' '.$GLOBALS['align']); ?></div>
- </div><div class="clear"></div>
- <?php endif; ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement