Put the following function in your functions.php
function wpse_62509_current_month_selector( $link_html ) {
$current_month = date("F Y");
if ( preg_match("https://wordpress.stackexchange.com/".$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' );
Related Posts:
- How to get these two divs side-by-side?
- How to change the color of an svg element?
- How to implement max-font-size?
- @Media min-width & max-width
- How do I center this form in css?
- How can I replace text with CSS?
- Float a div above page content
- What does an asterisk (*) do in a CSS selector?
- height style property doesn’t work in div elements
- How can I horizontally align my divs?
- background-size: cover not working?
- combined multiple classes into one css rule
- CSS Outside Border
- CSS – display: none; not working
- Is there an opposite to display:none?
- Rainbow gradient on text in CSS
- CSS3 opacity gradient?
- use multiple css filters at the same time?
- font-weight is not working properly?
- What would be the best method to code heading/title for ul or ol, Like we have caption in table?
- How can I make my header image properly responsive?
- CSS fixed width in a span
- Adding border to CSS triangle [duplicate]
- What is the correct way to enqueue multiple CSS files?
- Remove wp_add_inline_style
- Stylesheet switching and caching
- front-page.php stylesheet
- How to Add Admin Bar and Admin Menu or Submenu Notification Bubbles?
- Check and dequeue if multiple stylesheets exists using wp_style_is?
- plugin css is not being applied to the page?
- Why do WordPress default themes specify fonts in so many places?
- How do I make Div Container 100% width only on homepage of site?
- WordPress & W3C CSS Validation
- TwentyTwelve versioning
- How to highlight all current categories when viewing a single post?
- Duplicate attribute class causing site validation error
- Assets in css dont link properly in pages other than home
- How do I style WordPress pages differently based on the tag used?
- How/where to add additional stylesheet to WP
- How the Css File is Linked without calling it in header.php?
- Use stylesheet from a different location
- Show enqueued CSS and Script in custom header
- How to insert html/css/javascript code to wordpress plugin
- Importing changes to Child Theme
- Save changes in CSS after removing Menu from specific page
- Move the position of menu item [closed]
- Pure CSS to “float” to the right the number of children of an admin_bar child node
- Title has word broken when viewed in mobile [closed]
- Change background color of subpages
- How to fix this error? [closed]
- Advanced: understanding wp_add_inline_style function
- WordPress code editor messed up my code!
- Ordering stylesheet above using functions.php
- How to change “““ to “““?
- How to remove parent style.css from the header
- Placing background image over section divider
- Remove CSS & JS from
- enqueing Javascript and CSS
- Acessing HTML element with no specific tag on it [closed]
- Aligning line made with CSS [closed]
- Earlier stylesheet not overriding later one
- Order of WP page load (including widgets, php, plugins, media, templates, and CSS) [duplicate]
- CSS is not loaded on mobile devices
- Fixed height of the_content()
- How can I add inline CSS for each image?
- Creating a second menu on Twenty Eleven aligned right from the first
- Help with a little CSS logo/header modification?
- I have html form and need to make it work in text editor on template. Only problem is it has .sccs styling file
- underscores theme – sass folder structure vs smacss
- Inclution place of CSS file
- Unused CSS in WordPress Plugins
- I have text on a banner on my wordpress site and I am unable to get rid of it? Would appreciate any help or advice :-)
- Img load while refreshing
- How to change specific menu tab from left to right in My Home Theme?
- Twenty Fourteen: Unsticky header after making header bigger
- How to display javascript banner in website header?
- Loading css files conditionally useful?
- Is there any way to turn off a particular scrolling behaviour?
- Sidebar at bottom however I have completely replaced theme folder back to original code
- Site not 100% responsive
- Dropdown menu’s fighting with each other [closed]
- Customizer: CSS changes not persistent
- Move both sidebars more to their sides [closed]
- Header formatting works for safari but not chrome @media screen size technique on iphone
- Scale An Image Thumbnail
- Which hook to use to add notification message at beginning of my
- single.php doesn’t getting style
- Converting Static HTML pages to WordPress
- Background tiles not working in iPad2 but ok everywhere else
- How to make widgetized footer styles be inherited from body?
- custom css in admin panel by user id
- How to customize a theme’s navigation menu with css
- Site layout problems when logged in due to admin bar
- Add “sub-nav” class to a sub menu parent item
- Current Post/Page Ancestor, CSS
- [class*=”content”]:before css styles in TwentyThirteen [closed]
- How to change the CSS in one file?
- Custom css code in wordpress [closed]
- Using Easy Google Fonts correctly and Droid Sans on Max OS X [closed]
- remove white overlay [closed]