Hello.
I'm looking for some easy way to list all categories, subcategories, ..., and their posts in unordered lists. Something like site map, I think.
Thank you, for all responses,
Roman
Hello.
I'm looking for some easy way to list all categories, subcategories, ..., and their posts in unordered lists. Something like site map, I think.
Thank you, for all responses,
Roman
Here's one example:
<?php
//for each category, show 3 posts
$cat_args=array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories=get_categories($cat_args);
foreach($categories as $category) {
$args=array(
'showposts' => 3,
'category__in' => array($category->term_id),
'caller_get_posts'=>1
);
$posts=get_posts($args);
if ($posts) {
echo '<p>Category: term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.' </p> ';
foreach($posts as $post) {
setup_postdata($post); ?>
<p>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></p>
<?php
} // foreach($posts
} // if ($posts
} // foreach($categories
?>
Also look at this plugin:
http://wordpress.org/extend/plugins/sitemap-generator/
Thank you, MichaelH.
Now will try to understand it's functionality.
You must log in to post.