WordPress Archive drop down yearly (1 post)

  1. barnabasnagy
    Posted 5 years ago #

    I have a yearly archive drop-down select box on wordpress. Here is the code:

    <select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
    <option value=""><?php echo esc_attr( __( 'Select Year' ) ); ?></option>
    <?php wp_get_archives( 'type=yearly&format=option&show_post_count=0' ); ?>

    Once I select a year, say 2006, the drop down box should display 2006. At present it shows the default "Select Year".

Topic Closed

This topic has been closed to new replies.

About this Topic