WordPress.org

Ready to get started?Download WordPress

Forums

Thematic: Show archives in menu? (3 posts)

  1. thodah
    Member
    Posted 3 years ago #

    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?

  2. curlybracket
    Member
    Posted 3 years ago #

    Is this a code or a CSS problem ?

  3. thodah
    Member
    Posted 3 years ago #

    It's a PHP-code problem in the functions.php file because the code for categories works and it has the same CSS as the not working code for archives.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.