Created
August 6, 2015 05:59
-
-
Save aarifhsn/a01a649063bc60eaa896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--NEWS SECTION--> | |
<?php | |
global $post; | |
$args = array ('post_type'=> 'news-posts','posts_per_page' =>3); | |
$the_query = new WP_Query($args); ?> | |
<?php if ( $the_query->have_posts() ) : ?> | |
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?> | |
<div class="single_news"> | |
<?php the_post_thumbnail('news_post_thumb'); ?> | |
<div class="single_news_title"> | |
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> | |
</div> | |
<div class="single_news_content"> | |
<?php echo substr(get_the_excerpt(), 0,100); ?> | |
<a class="readmore" href="<?php echo get_permalink($post->ID); ?>">Read More....</a> | |
</div> | |
</div> | |
<?php endwhile ; ?> | |
<?php wp_reset_postdata(); ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment