WordPress.org

Ready to get started?Download WordPress

Forums

styling the wp_get_archives() menu (2 posts)

  1. brian914
    Member
    Posted 2 years ago #

    I am trying to style my menu created by wp_get_archives() like I did my menu created with wp_list_categories().

    Somehow the wp_list_categories() created menu gives me classes on each
    <li> like this: cat-item cat-item-25 current-cat, so I can style my current-cate link. But the menu created by wp_get_archives() does not do that. Am I missing something?

    Any help would be greatly appreciated with this!!!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    a possible way to add a few css selectors to an archive list:

    <ul class="archive-list">
    <?php wp_get_archives('format=custom&before=<li class="archive-item">&after=</li>'); ?>
    </ul>

    you could either use the class in the ul tag, or the parameters in the code, or both.
    (the 'wp_get_archives()' cannot output any numbered or current css classes).

Topic Closed

This topic has been closed to new replies.

About this Topic