<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( array( 'type' => 'yearly', 'format' => 'option', 'show_post_count' => 1 ) ); ?>
</select>
This code may help you.
Related Posts:
- How to call a PHP function from Javascript in WordPress
- WordPress Infinite Scroll without using any plugin
- How to preserve PHP modifications while upgrading WordPress?
- Calling a method from functions.php on a click of a button
- How to use WordPress (PHP) functions in AngularJS partials files?
- Understanding WordPress child theme custom JS loading
- Click loads template via ajax
- javaScript in section of WP API
- How to speed up admin-ajax.php in wordpress
- Adding tawk.to code just before body tag on functions.php file
- How do I fetch all comments per post via WP REST API?
- Slide in Panel WordPress Post
- How do I display a user’s previous orders as a select box option on a product?
- Trigger popup in a php if/else statement
- Use menu link or onClick to set a variable
- Populate dropdown with Child Pages based on Parent Page chosen
- remove wp floating submenu in wp dashboard
- How to complete two other input fields, completed the first
- JS file work only in index page
- dynamic dependent select dropdown
- Ajax load more button for comments wordpress
- Noscript not working as it should in wordpress site
- Tell WP register script to load a script only when the entire page is loaded
- Why i can’t get custom fields value or post ID via Ajax?
- How to reference PHP in Javascript
- Time Delay a URL Redirect for Specific Page
- WordPress User Meta value variable into Google Gauge Chart
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- Adding HTML Code to Replace Text in PHP
- Gutenberg block don’t save rich text content
- Trying to add some custom text into WordPress Post title via function.php
- Update $wpdb query with AJAX
- Using Javascript On Page – Header and Footer Now Missing
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- How do I make comment-reply-button with that takes to comment reply form on click
- custom post type column countdown
- How to call a function from functions.php with ajax?
- Custom Post type Ajax search results
- WordPress load javascript file if something… (after the page is loaded)
- Automatically refresh page if widget is added to page?
- Find the method which AJAX GET calls
- Display text of price (minus 20%) on every product page in a sentence.
- Help with my first Metabox helper class
- Trouble figuring out how to get my button to submit comment
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- hiddenQuestions.find is not a function
- Calling a function via a shortcode in javascript
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- Hide or Show Read More Button by Content Area
- How to redirect users to custom lostpassword page?
- Get post meta in enqueued js file
- Can I write ‘RewriteCond’ using ‘functions.php’?
- How to add 2 posts under another post? Formatting should be intact
- Get widget settings function?
- Archive dropdown styling not applied
- How to make custom total price reactive in navigation
- Creating a Multi-Level Associative Object Using AJAX
- add_action shortcut?
- ACF: how do I get the fields and its values of a specific group?
- search and replace preword from author
- Get page that displays all children of taxonomy parent
- Function to capture a value and store it in a variable
- Adding a widget function into the php theme file
- PhantomJS with wordpress
- My new button is in the wrong place
- Checking array against author id in loop
- Call to undefined method – Download Monitor
- wordpress wp_enqueue_script() not working
- Redirect to another page using contact form 7? [closed]
- Is it possible to return content, and then also continue to do other things?
- Can’t add script immediately after the opening tag on login page?
- Override user-edit.php to design own profile page
- How to use mysql LIKE with wpdb?
- Displaying Event within two given time frames
- How to add 3 weeks to the_time() function
- How to call custom function outside from the admin page?
- Woocommerce disable order item link (backend) [closed]
- Post form – AJAX won’t upload featured image – Plugin development
- How to add JS script in specific pages in WordPress?
- How can i find wrong word in search box and replace with correct word
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- Display one random image from Media Library
- How to override WooCommerce Order Item Meta with data from Cart?
- Taxonomy Child Term, Counter is staying on 0
- Notice: Undefined index: post_title error
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- Unable to pass arguments to function used in add_action
- Allow user to select location and then set cookie for location in WordPress
- Slider from different widgets
- How to get values from wordpress listings and use them in javascript array?
- Merge / Combine two php functions for Previous and Next Link with Thumbnail
- str_replace not responding in functions.php [closed]
- Trying to customize wordpress drop down categories
- Adding php within a return statement [closed]
- Displaying categories
- Error in php code
- Replace the image of a product with its video in the shop page
- How call WordPress shortcode inside function file