Tag Info

Hot answers tagged


The "Skip to toolbar" in the WP Navbar comes tabindex attribute set to 1; I really think it is correct because it is the first visual element when the navbar is active. The problem is that the HTML of the navbar isn't really the first in the source code, it is in the footer, so your form fields are first in the source code. When two elements has the same ...


Hook your form processing code to an action that runs before the page is rendered and no redirect will be necessary. function wpd_check_submission(){ if( isset( $_POST['start'] ) ) { // do your post insertion here } } add_action( 'init', 'wpd_check_submission' );


The context of your code that fails isn't entirely clear, but it's failing because get_the_ID() won't return a post ID when run on the init hook, because the main query hasn't been executed yet. If you have a look at the Action Reference, wp is the earliest action where you can access the current query's data, if your code is operating on the currently ...

Only top voted, non community-wiki answers of a minimum length are eligible