How to get the different categories Latest Article in one Page?

<div>LATEST ARTICLES</div>
<?php
$args = array( ‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘order’=> ‘DESC’ );
$postslist = get_posts( $args );
foreach ($postslist as $post) :  setup_postdata($post); ?>
<div>
<?php //the_date(); ?>
<div>
<?php //echo get_the_post_thumbnail($page->ID, ‘thumbnail’);
echo get_the_post_thumbnail($page->ID, ‘full’);
?>
</div>
<h3><a href=”<?php echo get_permalink($page->ID); ?>”><?php the_title(); ?></a></h3>

<?php
// Get the categories
$category = get_the_category();

// Get the 3 Latest Article
$string = get_category_link( $category[0]->cat_ID );
?>
<h4><a href=”<?php echo str_replace(‘category/’, ”, $string ); ?>”><?php echo $category[0]->cat_name; ?></a></h4>
<?php the_excerpt(); ?>
</div>
<?php endforeach; ?>

How Create Categorie Resent Post?

Display 5 latest posts in each category in WordPress


http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/

Display 10 recent post titles on homepage

http://codex.wordpress.org/Function_Reference/in_category
<strong>http://codex.wordpress.org/Function_Reference/get_the_category</strong>
<div>LATEST ARTICLES</div>
$args = array(‘orderby’ => ‘name’, ‘numberposts’ =>3, ‘category’ => 3, ‘order’=> ‘ASC’, ‘orderby’ => ‘title’ );
$postslist = get_posts( $args );
foreach ($postslist as $post) :  setup_postdata($post); ?>
<div>
<div>ID, ‘thumbnail’);
echo get_the_post_thumbnail($page->ID, ‘full’);
?></div>
$category = get_the_category();

$category_id = get_cat_ID(‘3′);
// Get the URL of this category
$category_link = get_category_link($category_id);
//echo $category[3]->cat_name; ?>
<h4>cat_name.'”>’.$category[3]->cat_name.”; ?></h4>
</div>
that’s all :)

© 2020 Spirituality