Hi every body mrphpguru here agian.
I am written this artical to list all post of a category wordpress plugings.
Now please open the archive page of the theam.
now just select the are where you want to display all the list of the post of a category.
<div id=”post_ran”>
<div>
<h2>List of post under </h2>
</div>
<div></div>
<?php
// Declare some helper vars
$previous_year = $year = 0;
$previous_month = $month = 0;
$ul_open = false;
// Get the posts
$myposts = get_posts(‘numberposts=10&orderby=post_date&order=DESC’);
?>
<?php foreach($myposts as $post) : ?>
<?php
// Setup the post variables
setup_postdata($post);
$year = mysql2date(‘Y’, $post->post_date);
$month = mysql2date(‘n’, $post->post_date);
$day = mysql2date(‘j’, $post->post_date);
?>
<?php if($year != $previous_year || $month != $previous_month) : ?>
<div>
<div><?php the_time(‘M’); ?></div>
<div><?php the_time(‘d’); ?></div>
</div>
<?php endif; ?>
<?php $previous_year = $year; $previous_month = $month; ?>
<div>
<h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2>
<div>
Posted by <?php the_author() ?> under <?php the_category(‘, ‘) ?> <?php edit_post_link(‘Edit’, ‘| ‘, ”); ?>
</div>
</div>
<div></div>
<?php endforeach; ?>
</ul>
</div>
<div id=”post_ran”> <div> <h2>List of post under </h2> </div> <div></div> <?php // Declare some helper vars $previous_year = $year = 0; $previous_month = $month = 0; $ul_open = false; // Get the posts $myposts = get_posts(‘numberposts=10&orderby=post_date&order=DESC’); ?> <?php foreach($myposts as $post) : ?> <?php // Setup the post variables setup_postdata($post); $year = mysql2date(‘Y’, $post->post_date); $month = mysql2date(‘n’, $post->post_date); $day = mysql2date(‘j’, $post->post_date); ?> <?php if($year != $previous_year || $month != $previous_month) : ?> <div> <div><?php the_time(‘M’); ?></div> <div><?php the_time(‘d’); ?></div> </div> <?php endif; ?> <?php $previous_year = $year; $previous_month = $month; ?> <div> <h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <div>Posted by <?php the_author() ?> under <?php the_category(‘, ‘) ?> <?php edit_post_link(‘Edit’, ‘| ‘, ”); ?> </div> </div> <div></div> <?php endforeach; ?> </ul> </div>
in the above code you can controll the number of post by changing numberposts=10
$myposts = get_posts(‘numberposts=10&orderby=post_date&order=DESC’);
numberposts=10 means it will display 10 post title
-1 will display all..
thanks
mrphpguru