Couldn’t you use the custom form like this:
STEP ONE:
Open a Text editor and paste your form content-
<?php
// Custom Contact Form
?>
<div id="my-ccf">
<form id="contactform" method="post" action="<?php bloginfo('template_directory'); ?>/_assets/submitemail.php">
<input name="user" type="text" value="Name" />
<input name="email" type="text" value="E-Mail"/>
<input name="url" type="text" value="Website" />
<input name="subject" type="text" value="Subject" />
<textarea rows="10" name="message" cols="50" id="message">Your message here...</textarea>
<input type="submit" class="button" value="SEND" id="send" />
<div id="error"></div>
</form>
</div>
STEP 2:
Save the file as my-contact-form.php (upload my-contact-form.php to your themes root directory)
STEP 3:
When you want to display your contact form, place this in the template file:
<?php get_template_part('my-contact-form.php'); ?>
Related Posts:
- How to display page content in a page template?
- Single page theme
- Single page theme that uses pages for the content
- Trying to list out child pages with WP_Query
- Front End Sorting Questions
- What are the differences between “Latest Posts” and “Static Page”?
- WP_Query doesn’t get sticky post at the top, when used in a page template
- Pagination of a WP_Query Loop in a child-page page template
- list pages using page.php and NOT page-{slug}.php
- Get pagination working for custom loops within page templates
- How is WP_Query parsed to determine which template to request?
- WordPress Pagination changes my template
- add_filter(‘query_vars’) not working in custom template
- Pass $page_id to new WP_Query
- Pagination on template page for custom query redirecting to index.php
- Create a page template for “top rated posts” but show full content and not just a list
- WP_Query returns different results from get_posts() [closed]
- inserting content of 1 Post to in another with a template hierarchy
- How to generate feed for custom template
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- wp_query on page template not working (Genesis framework)
- Pagination for custom loop on custom page template is not displaying anything
- How to create Page templates for showing Blog posts in different layouts?
- How to separate two columns from one content on a page template?
- What’s the best way to make a blog page on WordPress?
- How to use custom page for all posts with custom url, call another directory?
- INNER JOIN custom tables – SQL Query
- Pagination Shows Up But Won’t Work on Custom Gallery Page
- How to exclude posts by ID within a category/archive loop
- How can I use a specific wordpress page template if certain words are used in page title [closed]
- Fetching $_POST from Page Template into functions.php
- Using URL variables on a custom WP_Query
- Pagination is not working on custom query inside a custom home page template
- Passing query variables to a custom page template
- When importing a database any page with a wp_query in doesn’t work
- Having trouble using this post category query on multiple pages?
- Adding css tweak based on page template
- WordPress pagination returns the same posts
- Wp_redirect and sending variables
- How do I get posts that have a thumbnail in WP_Query?
- Multiple WP_Query loops with Pagination
- WP_Query with checkbox meta_query
- IP address character limit
- What is the most efficient way of querying posts based on visits and date for current day?
- How to add custom query filters in WP_User_Query
- How to order category.php loop by ‘meta_value’?
- Searching user meta using WP_User_Query
- Which custom query am I in and how can I access its properties & methods?
- Does using a custom query_var create a security hole?
- Date query not inclusive despite parameter being true
- WP_Query or get_posts?
- How to display the number of articles published per user
- How do you query wordpress posts using a math formula between multiple meta field values?
- Change default ordering of taxonomy terms – pre_get_terms
- Ordering Posts Type A by Custom Fields of related Post Type B
- Query Posts depends on custom field inside repeater field using acf
- Exclude old events from WP_Query with date saved in a `meta_key`
- current_post not working – give me -1 for every post
- Order posts by taxonomy count
- Query all published post AND attachment with specific mime type
- WP_QUERY to display woocommerce products whose author IS the logged in user
- When variable value have space between word, doesnt show any result WP_Query
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Make meta query treat meta_value as 1 or 0
- get all posts associated with a custom taxonomy
- WordPress query posts with multiple post_meta data
- Assign custom parameter to each post in query
- Exclude current post from an array of posts?
- How to set an alternate posts_per_page value for default queries in different templates
- How to remove only the latest sticky post from the loop
- Query posts using less than
- var_dump of WP_Query object is not empty, while .have_posts() return false
- How to show list of posts with custom field value (a date) that are coming soon
- Using WHERE on a WP_Query
- WP_Query meta compare must include ALL array values
- How to sort queried pages by an array of page ids?
- How to query for a page, get data, then query for child pages of that page
- WP_Query – display posts by custom field and order by another
- Custom WP Query order function possible?
- Is the ‘parse_query’ filter still valid to change filtered content on admin list view?
- I removed the “wp_rm_logs” table and am constantly getting this error
- How to set selected attribute on option after filter query?
- WP_Query returns empty if meta_query has more than 7 values
- query.php – multiple is_category functions
- Custom query with post_class filter using current_post not working
- Overwriting auto-appended NOT IN query in WP_Query
- posts_per_page not returning correct number of posts
- Conditionals in WP_Query
- Why WP_Query in functions.php is not working when get_posts works?
- Next / previous posts link doesn’t show up with Posts 2 Posts
- Loop the posts between two dates selected using jquery datepicker
- Passing conditional arrays to WP_Query() [closed]
- Issue with sorting by post date and custom post type
- wordpress sorting using array merge by price in ascending order but price with 0 must be show last
- Remove divs and spans from post content
- Can’t get LIKE to work with wp_query [closed]
- Get all user with both meta_value
- I want to place a post before all others from an ACF boleen field
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- wp_query, calculate with two dates when ‘key’ is text format