Support » Themes and Templates » Thematic: Show archives in menu?

  • I’m trying to modify the menu in the Thematic-theme to add a menu item with Archives. I found a working piece of code to do the same thing but with Categories, but when I try to modify this code to show Archives it doesn’t work as good.

    I want it to look like this:

    | Archive
    ---------------------|
    | September 2010 (2) |
    | August 2010 (1)    |

    But now it’s like this with two separate buttons:

    | September 2010 (2) | August 2010 (1)
    --------------------|-----------------|

    My code looks like this:

    function add_childtheme_archive_menu($args) {
        $archives = wp_get_archives('echo=0&show_post_count=1&title_li=<li><a href="#">Arkiv</a>');
        $args .= $archives . '</li>';
        return $args;
        } 
    
    add_filter('wp_list_pages','add_childtheme_archive_menu');

    The working code I found for categories is:

    function add_childtheme_category_menu($args) {
        $categories = wp_list_categories('echo=0&title_li=<li><a href="#">Kategorier</a>');
        $args .= $categories . '</li>';
        return $args;
        } 
    
    add_filter('wp_list_pages','add_childtheme_category_menu');

    What should I change to make it work right? And otherwise, is there a nice plug-in available for Archives which will give a similar result?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Thematic: Show archives in menu?’ is closed to new replies.