WordPress.org

Ready to get started?Download WordPress

Forums

Custom montly links in archive dropdown (1 post)

  1. gazpachu
    Member
    Posted 3 years ago #

    <div class="widget">
            	Articles Archives <a href="/news/archives">[index]</a>
                <select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
                  <option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
                  <?php $url = '<option value="/news/archives/year/month">'; wp_get_archives( 'type=monthly&format=custom&before='.$url.'&after=</option>&show_post_count=1' ); ?>
                </select>
            </div>

    How can I get the "year" and "month" values? is there any other way to do this?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic