wordpress 年別アーカイブ current カレント表示

 

function wp_acv_current_year( $link_html ) {
    if (is_year()){
        $current_year = get_the_date("Y");
        if ( preg_match('/'.$current_year.'/i', $link_html ) ){
            $link_html = preg_replace('@<li>@i', '</li><li class="arrow">', $link_html);
        }
    }
    return $link_html;
}
add_filter( 'get_archives_link', 'wp_acv_current_year' );