WordPress.org

Support

Support » How-To and Troubleshooting » WordPress Archive drop down yearly

WordPress Archive drop down yearly

  • 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' ); ?>
    </select>

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

  • The topic ‘WordPress Archive drop down yearly’ is closed to new replies.