You can try to use wp_get_archives() function.
Example from this link:
<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value=""><?php esc_attr( _e( 'Select Month', 'textdomain' ) ); ?></option>
<?php wp_get_archives( array( 'type' => 'monthly', 'format' => 'option', 'show_post_count' => 1 ) ); ?>
</select>
Related Posts:
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Dropdown Select Post Filter
- Apply the_title() filter in post & page title, but not in menu title
- Update post counts (published, draft, unattached) in admin interface
- Removing any and all inline styles from the_content()
- How does filter the_posts work?
- How to publish a post with empty title and empty content?
- How to add a “publish” link to the quick actions
- Why is wordpress removing some unicode characters (e.g. some emojis) when I save my post?
- how to display post content without post image?
- Exclude category on blog list page
- Filter posts by author and category simultaneously
- Filter post before *editing*
- Filter/Remove HTML Elements on all posts and pages
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Getting post id from wp_insert_post_data function?
- Filter Posts By Tag
- How can i do something after head like adding a hook for after head but before post
- Amend wordpress password function
- How can I remove posts of a certain category from homepage after a specified time period?
- How to generate numbers indistinguishable for the IDs of the posts
- Modify WP_Post before processing
- How to retrieve the postID in a “image_send_to_editor” hook function?
- Filter Custom Post Type by Category with Ajax
- Ajax posts filter by date, comments, top views, top likes
- How to add Tags Filter in wordpress admin dashboard
- Applying $posts_clauses filter to specific queries only
- how to remove dash (-) post status from post title on posts listing page wordpress
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- Get latest posts from WordPress site without header, menu and sidebar
- What is the filter or hook to add admin controls to posts on the front end?
- Change post order random through out the entire WordPress
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- How to hide html tags on revision comparison pages?
- Ajax post filters not working
- Default to ‘all’ view on the ‘edit-post’ screen for authors
- Display Meta Values in Custom Filter – Admin Custom Posts
- How to filter my search in post if contains a word in title, content or excerpt?
- More then one menu items are assigned with “current-menu-item” class
- Update post_content everytime a custom post is opened in backend
- Posts and Attachments with “Published” status in Search
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How to allow visitors to filter posts by multiple taxonomies
- Trying to alter the post_content through the_post
- Add filter to the end of the post
- Get post content with all filters applied, knowing post id
- Is it possible to filter the main loop to exclude posts from a specific category?
- query post limits
- Form to post new post with custom taxonomies
- Modify posts listing at back end
- Filtering posts on Post Administration Page by Week Number instead of by Month
- Prevent posts with certain post_meta to be edited
- Change the default blog post post attribute template name from “default template” to something else
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- Post filtering is returning blank page
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- How include css class based on post ( in loop ) slug?
- Restrict displaying posts to the poster itself (in Back-end)
- Exists filter or action that change Add New Post link?
- changing parent_id on post
- wp_list_categories() Exclude All Categories Except One
- Get current taxonomy and display query accordingly
- can’t modify post title using the_posts filter
- Show only posts with titles/permalinks that do not contain certain words
- How do I display main query posts in random order using add_filter
- How to edit a custom theme?
- Rewrite image links from attachment id to attachment link
- Using AJAX to filter posts without refreshing page
- Restricting displayed posts to posts from only select authors
- the wp_post_update isn’t working all the time
- Display/Filter post using if else statement
- How to add a custom class attribute into code wrapper? [duplicate]
- Filtering private Posts
- how to filter posts by category without page load (ajax) in wordpress?
- Remove status ‘archived’ from the default post and page view
- long-title posts do not want published
- How to add a block to a category page?
- How do i search post by jquery datepicker?
- Add id attribute to h1 element of wordpress post
- show only one category and filter by tag
- Prevent WordPress from putting around specific element
- filter buddypress users posts by user ‘xprofile’ custom fields
- How do I change the post title’s link on the posts page?
- How to create frontend Post filter using meta query
- Printable Page with all Posts from Tag
- How to test if user is filtering post list in dashboard
- Hide Admin posts & pages in Dashboard
- Is it possible to completely replace a post with an action/filter?
- How to get the postID inside ‘content_save_pre’? Other hook?
- Filter question list on substring of metavalue
- Add review box by function at top or bottom of content
- Get results from the main wp_query
- How to modify specific parts of a post content in WordPress
- Keep post format class with isotope filter
- Custom filter on all post page (admin backend)
- How to use in_category?
- the_content() not displaying the full post
- wp_query posts sorting doesn’t work
- Add custom PHP (no-SQL) filter to WP_query