I think the easiest way is adding the form via the Shortcode API. The code would look like this:
function myform_handler( $atts ){
if (isset(@$_REQUEST['submit'])) {
//Do something
} else {
$return = '<form action="" method="post">
<input type="text" name="myfield">
<input type="submit" name="submit>
</form>';
}
return $return;
}
add_shortcode( 'myform', 'myform_handler' );
Then you can add on any page the following Shortcode, that creates the form (and the form’s response):
[myform]
Related Posts:
- Char limit on custom blog-post form? [closed]
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Can’t edit Contact Us form on front page
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- Submit custom form from post content and execute in plugin
- How to allow user to select User ID in Formidable Pro form? [closed]
- Trying to create a table/list of my EventBrite course listings [closed]
- How do I use wp_editor() in widget form?
- How to reorder and display a feed to be chronological?
- Hide certain widgets from specific user roles in admin
- How to add Wrapper Div/container element around WordPress Widget Content
- Disabling plugin but wpenqueue is not available
- Related posts widget or plugin needed
- How do I find out what is in control over a certain part of a website?
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Is there a way to embed a Google Docs form in a page without using plugins?
- Problem since update 3.5 [duplicate]
- Call plugin with php function
- How to disable a widget when dependent plugin is inactive?
- Sidebar widget: Randomly select text from a given set
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- easy steps to make front end form without plugin
- Best practice for including plugin output in a template without using shortcode?
- How do I use add_action on custom widget?
- Form that generates an ID for the customer
- Submit Form data to another page via Ajax (WordPress Way)
- Editing a text file from plugin menu
- How can I delete a wordpress widget instance?
- Repeated Output in Widget
- Exclude posts from widget while post is showing on home, single and categories
- Custom widget doesn’t save values from dropdown box
- Register Script in Plugin Widget
- WordPress Apply filter in plugin causes 500 internal error
- Add Shortcode tag in Widget/Sidebar
- How to create wordpress widget that is fixed position on the home page
- Ajax Plugin Not Echoing Response
- Saving widget options from class method
- Plugin that will output submitted form data for user? [closed]
- Short messages widget [closed]
- Widget’s container?
- How do I add the same contact form to multiple wordpress sites and capture the response in one place or database?
- Add SideBar/Widgets Just Below the Post
- PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)
- Creating a widget and missing jQuery
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- jQuery Click event is not fired at all
- Creating a form and displaying entry data as a table
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- How can ι create my own (custom) WordPress table/list?
- Widget for specific category
- Gravity Forms returns to odd position
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- WordPress Multi-Step Product Search
- Plugin showing error
- Sell access to form [closed]
- get_term_meta returns false in widget
- File Uploader – Upload without adding to Media Library
- WordPress Widget Not Saving Instance
- Custom form not showing in correct place on page
- add_meta_box creating default form field types
- Form Plugin for Api Requests which is used via Shortcode
- How to redirect to a page after the form is submitted
- Call another page in forms
- How to set the default value as the saved value once a form of widget is saved?
- Echo out element to another page.
- How to Use the Filter “sidebar_login_widget_form_args”
- Select Form Element Not Saving from Plugin Options
- My widget won’t update its values when save is clicked
- How to display a widget on a page with no theme?
- Storing Form data in a different database
- Is it save to replace with in WordPress search form
- Widget where it can make changes to the container
- Contact Form 7 Plugin emails not being received by some accounts
- Accessing widget information
- Contact Form 7 “non-selectable” options in a drop down [closed]
- Widget content turns up before title
- Extend a plugin to include a widget option
- Using AJAX to run SQL statement and populate dropdown
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Looking for a simple checkout plugin [closed]
- Setting text widget to one page only
- How to add captcha to publish widget
- Modify pages widget and make a plugin?
- Redirect plugin after form submit or show errors
- wp_footer hook running twice
- Plugin for visitors to edit content without logging in? [closed]
- Listing all sidebars
- jQuery slider widget similar to cnet.com
- Why aren’t my Follow Me links working?
- Is there any plugin to show number of clicks on the link?
- How do I send the contents of a form to deliver to the already existing custom field in the wordpress theme
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Unable to locate inline CSS causing parts of page to be blank
- Table of contents (TOC) plugin is not showing header tag
- Linking form to user meta fields
- WordPress Forms Advance Conditional Logic
- co-authors plugin – inline listing
- get wpforms ID value from ACF text field