kode ini menampilkan semua post dari semua kategori:
`<h2><?php _e(‘Archives By Category :’, ‘belajar’); ?></h2>
<?php // cycle through categories, print 20 post for each category
$categories=get_categories(‘orderby=name&order=ASC’);
foreach($categories as $category) {
$posts=get_posts(‘showposts=20&cat=’. $category->term_id);
if ($posts) {
echo ‘<h4>Category: <a>term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s”, ‘belajar’), $category->name ) . ‘” ‘ . ‘>’ . $category->name.'</h4> </p> ‘;
foreach($posts as $post) {
setup_postdata($post); ?>
<ul>
<li>
<a>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a>
</li>
</ul>
<?php
} // foreach($posts
} // if ($posts
} // foreach($categories
?>
</a>`