It’s not working because:
- You are redirecting home
- You don’t listen for the
$_GET
variable so the archive link is just appended to your home url
You need to add a function that listens for that $_GET
variable.
just add this to your functions.php
file
add_action( 'template_redirect', 'wpse_archive_select' );
function wpse_archive_select(){
if( isset( $_GET[ 'archive-dropdown' ] ) ){
die( wp_safe_redirect( $_GET[ 'archive-dropdown' ] ) );
}
}
Related Posts:
- How to add “on change” to a text input in contact form7?
- How to change number field to text field using JS
- Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- Reactjs – Form input validation
- Angular: mat-form-field must contain a MatFormFieldControl
- No value accessor for form control
- Send POST data using XMLHttpRequest
- Setting onSubmit in React.js
- jQuery AJAX submit form
- How to reset a form using jQuery with .reset() method
- JavaScript post request like a form submit
- Phone mask with jQuery and Masked Input Plugin
- How to create a HTML Cancel button that redirects to a URL
- What does ngf-select do and why is it needed for form validation?
- JavaScript post request like a form submit
- How can I get form data with JavaScript/jQuery?
- {“error”: “Please use POST request”} – alternative solution to submitting a form
- FormData append not working
- JavaScript code to stop form submission
- how to write javascript code inside php
- What’s a Good Javascript Time Picker?
- ngular is automatically adding ‘ng-invalid’ class on ‘required’ fields
- Add custom form to theme
- How do I embed a Javascript form directly into a page?
- How to load javascript file on homepage in WordPress in order?
- Gutenberg get core data – search
- Change/Replace keyboard character on keypress while writing new post
- How do you filter the list of states when country is selected? [closed]
- Uncaught ReferenceError: jQuery is not defined – although jQuery is loaded [closed]
- Why does a on Comment edit page submit the page?
- Add captcha validation to my custom form for Frontend posting
- How to add a onclick attribute to a list of checkboxes?
- Close modal window after form submit [closed]
- Form will not popup, when clicking on the link to the form
- How to show cities according to the state in Form using Javascript? [closed]
- Can’t Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM
- Error handling for wpdb error – displaying an error message to the user
- dropdown does not work [closed]
- CCF7 Field numbuer prefilled after Click event
- Sending GravityForms to custom HTML
- WordPress 4.2 mce-views migration guide?
- Receive “menu-toogle” event from section menu in customizer
- Adding javascript blocks to a single file and adding it to the header
- Ajax Form data is not posted back to the get_results()
- None of the JavaScript works when using wp_editor
- JS files landing on page but not working, using childtheme of twentyeleven
- WordPress 4.1 crashes loading of ArcGIS Javascript API
- jQuery + more won’t load in header
- Simple email input store in database
- How to modify a class in load-scripts.js ?
- How do I convince this button to do something when it is clicked?
- Convert javascript running xml files to wordpress platform
- wordpress option page data from select form is not saving to database
- WOW.js Script Tag Initialization Header/Footer
- Remove WordPress default registration client side validation?
- How to integrate a different (JavaScript) editor in WordPress?
- JS enqueue path (localhost)
- Load and execute javascript from body
- Why can’t I load JS script in a plugin?
- Page template dynamic links based on browser size
- javascript errors on mobile browser, not on desktop
- Passing input value into name of input
- Auto Select Child categories on Multiple Dropdown – Jquery
- Trigger a function during onload
- How do I capture the selected option and pass in sending the registration form?
- Loaded JavaScript file not showing [duplicate]
- WordPress Theme – jQuery JavaScript Library Issue
- I keep getting Javascript error messages
- How to add additional JavaScript code [duplicate]
- custom page url slug needs illegal ?id=1 for javascript
- Script loaders vs wp_enqueue_script
- PHP or JS for header image rotator?
- convertEntities() used before it is defined
- Block pattern conflict with custom block
- Use one javascript variable into another javascript file
- JavaScript: TypeError: xyz is not a function after upgrading WordPress
- How do I find stylesheet & javascript handles? [duplicate]
- Bad Request when adding new post via ajax form
- JavaScript errors
- JavaScript file successfully registered but does not render correctly
- Don’t understand how to link Javascript files in WordPress
- How could I add load more posts to my theme? [closed]
- Disable PAGESPEED SCRIPT INJECTION to IMAGE in theme files [closed]
- How to Create a Repeatable Meta Box
- How to keep close a sub-menu under homepage? [closed]
- Custom JS doesn’t work after 4.9.9 update [closed]
- How to implement custom URL handler to access JS modal content? [closed]
- Contact form 7 hide and show fields depending up on the condition [closed]
- Loading 2 Different Version of JS files [closed]
- List unused javascript for easy removal
- Embed Kajabi into WP
- Include Facebook Javascript SDK In WordPress
- Mobile menu will only toggle on
- Making the HTML list to a checkbox tree with the plugin jstree [closed]
- How can I stop loading wordpress jquery on header?
- Why the images on mi javascript are not found?
- Live Time on WP showing weirdly [closed]
- Add Javascript/Html into a WordPress
- Javascript button to call custom fields data
- Javascript 2 elements dependent onclick .toggle [closed]