Skip to content

Instantly share code, notes, and snippets.

@aslamhindko
Created June 1, 2016 07:10
Show Gist options
  • Save aslamhindko/5ce8723b9dbaf2065d40fbe87b69ee3d to your computer and use it in GitHub Desktop.
Save aslamhindko/5ce8723b9dbaf2065d40fbe87b69ee3d to your computer and use it in GitHub Desktop.
<div class="container blogframe">
<div class="row">
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$q = new WP_Query(
array(
'post_type' => array('post'),
'post_status' => array('publish'),
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 9,
'paged' => $paged
)
);
?>
<?php while ($q->have_posts()) : $q->the_post(); ?>
<div class="col-md-4 col-sm-6">
<article class="bpost">
<?php
if(has_post_thumbnail()){
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(),'full', true);
?>
<img src="<?php echo $thumbnail[0] ?>" width="306" height="200" alt="mproduct">
<?php } ?>
<span><?php echo get_the_date(); ?></span>
<h1><?php the_title();?></h1>
<p><?php echo substr(strip_tags(get_the_content()),0,250); ?>...</p>
<a href="<?php echo get_permalink($post->ID);?>"><i class="fa fa-angle-right" aria-hidden="true"></i></a>
</article>
</div>
<?php endwhile; ?>
<div class="text-center">
<?php if (function_exists("pagination")) {
pagination($q->max_num_pages);
} ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment