It looks like the code in contactform.php
may be causing issues.
These lines, specifically:
global $wp;
wp_redirect(home_url($wp->request));
exit;
The exit
statement may be stopping execution of the rest of the script. If you want to process form data, you should be checking for it and processing it instead of just running the redirect and exit statements whenever the part is included.
Related Posts:
- Passing variables through locate_template
- How to use get_template_part()?
- Is there a variable for a template parts name?
- How to make get_template_part always check child theme first?
- Check if partial file is called from within header.php or footer.php
- Too many get_template_parts?
- get_template_part() does not work if you call it when you are in a subfolder
- Pass a variable to get_template_part
- get_template_part inside get_template_part?
- Getting the chosen template when iterating through pages
- Possible to use pagename inside get_template_part?
- Why would include(locate_template) work but not get_template_part()?
- How does get_template_part() work inside a loop?
- Is there a tirck in the get_xxxx function in the general_template.php file?
- how to remove get_template_part from a plugin? [closed]
- get_template_part() based on get_post_type() for a custom post type instead of get_post_format()
- Using get_template_part to retrieve a template file based on current post type
- add a hook with get_template_part()
- ä/ü/… are not displayed when including via get_template_part()
- Change the file path on get_template_part via plugin
- How to limit the number of Related Posts?
- get_template_part – how to find html file which is being render
- Get_Template_Part And Two Global WP_Query On Frontpage
- The use of get_template_part() returns ‘invalid argument’ loading options
- Passing a variable from the archive page to the default template
- For which reasons can get_template_part’s $args fail to work? (WP 5.8.1 – PHP 7.4.23)
- Can I set a global base path for get_template_part?
- how to use a different template (index.php) in wordpress
- What are the benefits of using get_template_part()?
- Include template file from plugin to theme
- get_template_part doesn’t output all data
- get_template_part vs action hooks in themes
- When is get_template_part() preferable to simply using the template.php files?
- Variable use in get_template_part
- Get template part vs locate template function
- Single Page WordPress Theme – Using page templates
- _wp_page_template to dynamically use template
- Templates & CSS – Proper Programming Practice?
- Which custom query am I in and how can I access its properties & methods?
- get_template_part not working with ajax
- Passing variables to template parts
- Correct way to use get_template_part() and get_post_format() with custom post types?
- How to pass variables with get_template_part?
- How to localize inline script called with ajax
- ACF Relationship + WP Template Parts
- Checking whether template part is loaded in a page
- Template part inside shortcode, unexpected reult
- get_template_part for each level of taxonomy term
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Unexpected results with conditionals inside template part
- get_template_part and template file names
- What is the best way to organize template parts?
- Get template part using a custom taxonomy term
- how could I load a different template part by page
- Get_template_part inside a folder
- Problems with loop
- Conditional get template part
- Don’t see add_filter result in the site front page
- Showing the WordPress standard text area on a Woocommerce Single Product Page?
- Modal working only on home page
- Detect if current page is front page within custom query
- Using same variable names in files added with get_template_part()
- Check for the main query from the template
- get_template_part() doesn’t work
- how to replace get_template_part(‘loop’,’tag’) with explicit styled version?
- Custom post type index (maybe using get_template_part)
- Using ob_start and ob_get_clean with wordpress shortcode
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Does get_template_part() content gets parsed if it’s not executed?
- Get_template_part seems to be ignoring my template
- using get_template_part() inside a widget and passing variables
- Is there a way to retrieve the calling template part?
- Use of IF statement in Header file
- Is there a way to call on just the content of a Page without actually using that Page? [closed]
- Is “get_template_part” hierarchy possible?
- Is it possible to have a Theme with built-in physical page files?
- Organize template parts and page templates in folders in regards of template hierarchy
- On click some element i want to use some template
- Template not loading with get_template_part or locate_template
- Load templates, pass arguments, and render output from functions.php
- Contain multiple page templates in one PHP custom template file in WordPress?
- Ajax and get_template_part
- Is_Page doesnt detect my page
- do_action doesn’t trigger if it’s in a template that gets loaded via REST endpoint
- Shortcode and get_template_part
- Display a custom 404 page without a redirect
- Remove a short code and update it’s content (AJAX)
- How to get value from radio buttons meta box, and return different contents?
- How can I show contents of a template part inside of another page?
- Call get_template_part() custom permalink
- Use another theme template in my theme
- When to use content-pagename.php?
- Theme parts path location dump
- Re-using single CPT code with get_template_part?
- how to modify request to get_template_part()?
- what template-part to call, to have my post in the center of the page?
- If I define a variable in header.php, how do I make it available to templates?
- First post outside of loop, homepage only?
- Headers already sent error with get_template_part in REST API call
- get_template_part() does not render after the ajax request