You could filter home_template
, check for the presence whatever $_GET
var is reliably set for each of those requests, and load a different template for those cases.
function wpd_home_template( $home_template="" ){
if( isset( $_GET['search_type'] ) ){
$home_template = locate_template( 'homesearch.php', false );
}
return $home_template;
}
add_filter( 'home_template', 'wpd_home_template' );
EDIT- fixed incorrect var test.
Related Posts:
- Restrict a search to a custom post type
- Modifying searchform.php and search.php to have two kinds of searches
- Unable to create custom search results template page
- get_search_link() redirects to 404 template page
- Search results when none found – stay on page they were on
- Redirect template based on permalink rather than $wp_query
- Standard WordPress Search does not work / Search-results are not displayed / Custom template
- How to identify which template WordPress’s default search-form retrieves in my theme
- How do I override the search template in a plugin?
- Conditional to determine if search.php page is the current template
- use a custom page to display search results
- How to name custom search page PHP file?
- Search button click sends to single-custom_post_type instead staying at the same page
- how to change custom post type search template to output search results in posttype-archive.php
- Where is search.php?
- Is it possible to return a specific tag archive/template as one of the search results?
- Search results in custom template
- How to use Class
in Java? - How to edit contents of dynamic_sidebar()?
- Loading partial templates with AJAX/PJAX
- Where to store some per-template preferences?
- How do I override template-tags.php in twentyseventeen theme
- roots child theme can’t override header.php
- When calling wp_title(), do you have to create some kind of “title.php” file?
- Stream Video Player does not work with do_shortcode()?
- Adjust the results quantity for Search Results page pagination
- How does wordpress blocks?
- Which has more impact on site performance? Template overrides or hooks
- Subpage template
- Advanced Custom Fields – display when specific template used?
- What should I put on my index.php?
- How To Create WooCommerce Custom Template For Specific Product?
- How to Use Twig + Timber with Multiple Loops based on Meta Key Value
- Programatically create a page
- Missing .twig files in wordpress theme editor
- How to custom page template for the Gutenberg editor
- Directly using pure JWPlayer JS (but NOT WP Plugin)
- Login page theming?
- I want to add a custom “all posts by author” by authors name. How?
- Advanced templating / WordPress as a CMS questions
- displaying category and subject posts
- Custom templates vs page-slug
- get_template_directory() still returning path to previous theme
- URL / Templating system advice [closed]
- What’s the purpose of $wp_did_header?
- Trying to display short code content in template file with do_shortcode()
- How to use index.php as a template for archives?
- How to customize WooCommerce templates to avoid override upon update [closed]
- Creating new content types (Pages, posts, testimonials, tigers, oh my!)
- Dynamically Insert Image Into Stylesheet
- How to access .html file that’s located in the theme folder from the browser?
- Way to use one template but be able to call different top graphics?
- How to implement my custom development multiple PHP page work into WordPress?
- Create template for just a print
- dynamic_sidebar() stopped working
- Index template always follows page_template() template?
- WP overwrites my setup_postdata() setup
- wp_list_authors() returning the wrong member url
- Sending email for the custom form in WordPress
- How to add search to menu?
- Hard Coding Components on a Client Specific Websites
- Query the database after get_header() has been included
- Does wp_mail work in frontend tempate file?
- Dynamically generated URL and Content page
- Organize template parts and page templates in folders in regards of template hierarchy
- Custom /Page/2/ Template Only
- wordpress – modifying template to show more posts
- How to get all template files used for rendering a single post/page?
- How to insert “get_template_part()” based on Category ID?
- Home page not loading after editing header.php file
- How can I include ALL post types in the_post_navigation() links, not just current post type?
- Template includes
- Two different single.php depending on source page
- Attachment URL for an image is loading direct image file
- I’ve installed example data on Nominee template but the published site shows another version of the site
- Set og:image programmatically in custom single post with external images
- Displaying all posts of a category in full view on one page using their single.php template
- why does not showing my custom post category list in any template?
- Locating the HTML piece of code in wordpress
- Custom Template doesn’t output result when set as homepage
- Theme keeps going to default files [closed]
- How can I show contents of a template part inside of another page?
- How to serve a amp template
- Single page applications with WordPress: routes and templates
- Inserting javascript file into theme template?
- Creating custom post-listing templates in twentyseventeen child theme
- Display different list of “Custom Templates” for each Custom Page Type
- Submit form to another template (ugly url)
- Page Templates Used in Custom Post Type
- List all pages using a specific template on a page
- Duplicated Template Does Not Load the Same as the Original Template File?
- Blog template PHP [closed]
- load_textdomain won’t load my .mo file
- files disappearing from template
- why does blog page ignore template [closed]
- html blog template to wordpress template
- How to limit block activity (insertion/deletion) to inside of a Block Template on the Admin Screen?
- How to change post template
- WordPress template restored by mistake
- Unload templates; disable parent Template Parts using only “theme.json”