/ Published in: PHP
http://www.briangardner.com/archives/
http://diythemes.com/thesis/rtfm/create-customize-archives-page/
http://diythemes.com/thesis/rtfm/create-customize-archives-page/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function my_archives_template() { echo '<ul>'; 'orderby' => 'name', 'order' => 'ASC' ); $categories=get_categories($cat_args); foreach($categories as $category) { 'showposts' => 50, 'ignore_sticky_posts'=>1 ); $posts=get_posts($args); if ($posts) { echo '<li><a href="' . get_category_link($category->term_id) . '" title="' . sprintf( __("View all posts in %s"), $category->name) . '" ' . '>' . $category->name .'</a></li>' . "\n"; echo '<ul>'; foreach($posts as $post) { setup_postdata($post); $ptitle = $post->post_title; $plink = get_permalink($post->ID); echo '<li><a href="' . $plink . '">' . $ptitle . '</a></li>'. "\n"; } // foreach($posts echo '</ul>' . "\n"; } // if ($posts } // foreach($categories echo '</ul>'; } remove_action('thesis_hook_archives_template', 'thesis_archives_template'); add_action('thesis_hook_archives_template', 'my_archives_template');