WordPress.org

Ready to get started?Download WordPress

Forums

Archive dropdown for custom post type (1 post)

  1. sdesigns
    Member
    Posted 1 year ago #

    I am tring to figure out how to have a dropdow that shows an archive of posts from a custom post type. I am using the code below but I cant figure out how to only show posts from the letters post type.

    Thank you for any help on this.

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

Topic Closed

This topic has been closed to new replies.

About this Topic