<?php
global $post;
$dataargs = array( 'posts_per_page' =>2, 'offset'=> 0, 'category' => 432 );
// 432 is a cat id
$specialposts = get_posts( $args );
foreach( $specialposts as $post ) : setup_postdata($post); ?>
<div class="pi-grid-item" >
<article class="post">
<div class="post-media">
<h4 class="widget-title"><?php echo the_title();?><span></span></h4>
<div class="images"><a href="<?php echo the_permalink();?>"><?php echo the_post_thumbnail(array(50,75)); ?></a></div>
<p style="margin-top:10px;"><?php echo the_content();?></p>
<a href="<?php echo the_permalink();?>" class="alignright">Read More</a>
</div>
</article>
</div
<?php endforeach; ?>
Alternate:
<?php
$args=array(post_type=>post, cat=>432,posts_per_page=>6);
query_posts($args);
if(have_posts()){
while(have_posts()){
the_post(); ?>
<?php } } ?>
global $post;
$dataargs = array( 'posts_per_page' =>2, 'offset'=> 0, 'category' => 432 );
// 432 is a cat id
$specialposts = get_posts( $args );
foreach( $specialposts as $post ) : setup_postdata($post); ?>
<div class="pi-grid-item" >
<article class="post">
<div class="post-media">
<h4 class="widget-title"><?php echo the_title();?><span></span></h4>
<div class="images"><a href="<?php echo the_permalink();?>"><?php echo the_post_thumbnail(array(50,75)); ?></a></div>
<p style="margin-top:10px;"><?php echo the_content();?></p>
<a href="<?php echo the_permalink();?>" class="alignright">Read More</a>
</div>
</article>
</div
<?php endforeach; ?>
Alternate:
<?php
$args=array(post_type=>post, cat=>432,posts_per_page=>6);
query_posts($args);
if(have_posts()){
while(have_posts()){
the_post(); ?>
<?php } } ?>
No comments:
Post a Comment