show one or more post in wordpress
show one or more WordPress post in header , index , or category page according to you
<?php
$args = array( 'numberposts' => 1, 'order'=> 'ASC', 'orderby' => 'id', 'category' => 3 );
$postslist = get_posts( $args );
foreach ($postslist as $post) : setup_postdata($post); ?>
<?php the_content(); ?>
<?php edit_post_link('Edit'); ?>
<?php endforeach; ?>
numberposts = how many post , you want to show
order = ASC or DESC
orderby = id , title , etc
category = category id
this post is very helpful for me , thanks to posting this information
ReplyDelete