0

I am using Wordpress archive widget to display archives of My WordPress site. But there is a condition, I want to display only last year archives, not this year. I am using inbuilt widget, so what can I do to stop this year's archive coming on the widget?

1
  • So you want to use the default Archive widget but restrict it only to the last year or do you want to remove only the current year?
    – birgire
    Jan 9 '18 at 8:49
0

test below plugin . I hope your problem is resolved

Simple Yearly Archive

Archives by Category and Date

0

Use below function in your function file.

    function limit_archives( $args ) {
    $args['limit'] = 1;
    $args['type'] = yearly;
    return $args;
}
add_filter( 'widget_archives_args', 'limit_archives' );
add_filter( 'widget_archives_dropdown_args', 'limit_archives' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.