Did you try adding a value to the input field? It looks like you are using a submit input field, not a text input field. <- Never mind, it still isn’t null after submitting.
In order to troubleshoot, try adding the following to the top of your code:
<?php
echo 'Post variables:<br />';
print_r($_POST);
?>
Also, where are you placing this code? I dropped your code straight in to the header.php file of a custom theme and it worked as expected.
Related Posts:
- Get current menu_order
- Get content from one page and show it on another page
- get_children() Not Working with orderby Parameter
- Post/Page Publish/Update button not clickable once I make an edit
- Custom Field in Featured image for A particular post
- Is there a WordPress equivalent to MediaWiki templates
- Getting an alphabetic post list with two letters onclick on letter
- Pagination not working on Custom Page Template
- Is it possible to show a different WP menu when using password protected pages?
- how to show all post in my page-grid.php template page
- eBooks download website, page or post?
- Multiple loops in same page, without duplicate content
- Include related posts on a page
- why does HTML Tag not working in Post and Page
- problem to delete page
- Can I hide a specific post from latest posts page?
- Redirect before post page
- $post object is null
- How to show post(excerpt) from specific category on wp page?
- Is there any WordPress alternative to Book module of Drupal?
- Convert a complex webpage into WP theme
- Single post as homepage?
- Should a photo gallery be in a post or on a page?
- Can I divide the pages into categories?
- How can I pass the ID of a post to a page template by clicking a url?
- Multiple loops are not reset
- Drag posts and pages so you can sort them in order
- Why aren’t my posts/pages showing up in my WordPress Theme?
- Adding buttons to Add New Post and Add New Page
- 301 (static page instead latest posts)
- Static posts page with home.php
- Using wp_list_pages() after calling query_posts()
- Posts vs Pages and categories
- How to dynamically parse and transform post/page content before displaying it?
- Proper way of establishing custom landing pages in WordPress
- is_page Funtion for Posts ?
- WordPress Query Posts From Category Post on Static Page
- Intercept page request and add value to it
- How to create a page that shows the last 10 posts?
- $_GET parametters not working in an specific template
- get_children returns older images
- the_content() Not Grabbing All Content
- Detecting current page from class method
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- I don’t want the complete article to show on homepage
- Change Author Name to Sitename on Frontend
- Display on page every post in blog WITH comments
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- Create a frontpage.php and static page template
- posts going to 2 pages/categories only show up in 1
- Have posts included on a page that share same category
- Preview page/post revisions without overwriting current content
- Link from Post to Another Post Via Clicking on Words within Original Post
- Link to older links
- Organization of time insensitive content
- How to show next/prev link, when it’s not active?
- Archieve page, Advertisement Every 3 Posts
- Prevent duplicate pages from being added
- What would causes search to return incorrect results?
- Separate blog and reviews categories
- Edit post & page option does not display on latest wordpress
- Is there a way to find all posts with Youtube video embedded?
- Change the size of the featured image for post?
- Go back to the exact post page number
- WordPress empty page! what is wrong with this code?
- Add CSS and JS files of the template post on a WordPress page
- Can’t find webpage on All Pages or All Post menus
- Remove status ‘archived’ from the default post and page view
- Parent menu item does not display posts when I add the sub-items
- How to distinguish pages created by woocommerce?
- Display all tags even if they are not assigned to a post
- how to put post customized in page
- Show code only on WooCommerce Pages
- Count posts for pagination
- Custom permalink for wordpress page / post
- Multiple Pages – Seperate blogs
- How to add post under particular pages? Like website.com/page1/post1
- I lost the link to my posts in my menu bar
- Posts on Sidebar only
- Posts are not showing up on next page.
- How to give priority to page than to posts permalink structure?
- Hide Admin posts & pages in Dashboard
- structure of posts and pages
- Posts in Page – How to customize the URL?
- Display only current page -> posts tags in page
- Display all posts/pages in a multiple selectbox
- How to mix pages and sub-categories in a url
- How can i add new post on new page
- Make a custom URL and link to custom Template
- Cant retrieve $_POST inside page, just header
- how to style an individual page in a category [duplicate]
- Woocommerce – custom post type of checkout page
- Posts and pages not getting published
- Adding a post to a page
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- The page that displays Posts on homepage
- change page name on page list
- Cannot Create a new Post [closed]
- How can I use wp_after_insert_post with $current_screen?