<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
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- How can I modify the permalink via a filter?
- Shortcode putting html such as
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Use WordPress’s Media Uploader/ Manager in non WordPress php application
- How to check If Oembed is empty or not
- How can I output a php value into a JS file within WordPress?
- Image as Sales Badge
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Css loads very slow [closed]
- Show when user is online/offline in real time on user_profile.php
- Add / Update Custom Fields After Select Pictures in Media Window
- Call to undefined function get_userdata() in plugin
- how to test for all children (including multilevel grand-childern) of page
- Dilemma of Populating all the categories in a drop down list
- Add item to top of menu using a filter in functions.php
- Limit Taxonomy Output in Conditional Statement
- wp_redirect only works on main site and not on other sites
- require_once() if a product in woocommerce contains a tag [closed]
- How do I get my Javascript scripts working?
- Shortcode for Listing Users from Meta Value?
- Display css ONLY on most recent post of specific category?
- How to remove the space before the ellipsis in excerpt?
- Calling PHP Titles inside Javascript Markup
- How can I use custom menus with a Bootstrap WordPress theme?
- How to redirect non logged in mobile users to page on same site?
- How to remove/hide collapse menu for user/subscriber?
- How to implement __() function in my theme’s php file?
- Decode and Decrypt Azure B2C OpenID Authorization Token, Use Response in API Call (Example Token Within)
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Get custom field value from the function.php
- Non-blocking file_put_contents in function.php
- Restrict wordpress access to logged users only
- Discount in the specific product title using keyword ( Woocoommerce )
- How best to check if a user is from China and hide content?
- Bring Font Awesome icons inside menu A tags
- Menu to the right of screen on desktop using Bootstrap 4
- scroll scrpit to particular button position to next id when click button
- What is wrong in this code?
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Show custom default avatar instead of gravatar
- WordPress 2014 Theme – Featured Content with multiple tags?
- Facebook share button only share the_permalink(), without thumbnail, tilte, excerpt, etc
- ajax form function error
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- How to display the date under the post title?
- Simple Probléme in wordpress
- How can I use AJAX in child theme template?