Question: I'm looking for how to get a class in the wp\_get\_archives functions to get the current month (when we are in a month archive) just like when we call wp\_list\_categories, the current category has a ".current-cat" selector for CSS or when we call wp\_list\_pages we have a '.current\_page\_item' selector.

Answer: 
Put the following function in your `functions.php`

```
function wpse_62509_current_month_selector( $link_html ) {
    $current_month = date("F Y");
    if ( preg_match('/'.$current_month.'/i', $link_html ) )
        $link_html = preg_replace('/<li>/i', '<li class="current-month">', $link_html );
    return $link_html;
}

```

And then add the following line just before calling `wp_get_archives()`

```
add_filter( 'get_archives_link', 'wpse_62509_current_month_selector' );

```

You might also want to remove the filter after calling `wp_get_archives()` so that it doesn't mess with other `wp_get_archives()` or `get_archives_link()` function calls.

```
remove_filter( 'get_archives_link', 'wpse_62509_current_month_selector' );

```
As of WordPress 5.3, `<a>` elements generated by wp\_get\_archives ([etc](https://make.wordpress.org/core/2019/09/23/core-widgets-new-aria-current-attribute-in-wordpress-5-3/)) for links to the current page have the attribute `aria-current="page"` added to them. If you just want to style the current page link differently, you can now target this with CSS, assuming you are happy for the styles to all be on the `<a>`:

```
a[aria-current="page"] {
color: red;
}

```

…or even just:

```
a[aria-current] {
color: red;
}

```