WordPress.org

Forums

How to use wp_get_archives? (3 posts)

  1. peterwsterling
    Member
    Posted 8 years ago #

    How am I supposed to use the wp_get_archives function?
    I'm using it with the format=option set, i.e.:
    <?php wp_get_archives('type=monthly&format=option'); ?>

    It creates a list of options, with the full URL for the selected one as the value. But what form code do I have to wrap this with to navigate?

    Thanks,
    Pete.

  2. GaryofBeeston
    Member
    Posted 8 years ago #

    Can I float this to the top, rather than starting a new thread? I have the same problem (running 2.2). The <option> code is generated fine, and I added the <select> tag around it, but there's no submit button or onFocus() - style code generated, so selecting anything on the list does nothing.

    Which looks a bit silly (lucky for me, no-one ever reads my site...)

    Gary

  3. MichaelH
    Member
    Posted 8 years ago #

    In Version 2.2, the native Archives widget offers a dropdown ability. Maybe you can use the example in lines 383-406 of wp-includes/widgets.php.

Topic Closed

This topic has been closed to new replies.

About this Topic