Hook into 'template_include'
and change the template here.
Made up example, not tested:
add_action( 'template_include', 'wpse_96472_search_template' );
function wpse_96472_search_template( $template )
{
if ( ! is_search() )
return $template;
if ( empty ( $_GET['post_type'] ) )
return $template;
if ( 'poster' === $_GET['post_type'] )
return get_template_directory() . '/poster-search-template.php';
if ( 'house' === $_GET['post_type'] )
return get_template_directory() . '/house-search-template.php';
return $template;
}
You have to change the template names and the $_GET
parameter name of course.
Related Posts:
- Add infinite scroll to content splitted post
- How to give paged links custom title?
- Manual excerpts for pages not working on Search
- Custom Search Page Pagination Not Working
- When I split a large post with , how can a search locate users to the correct page?
- Form action redirect to the same page
- Is there a wordpress plugin enabling an autocomplete search box, then jump to page?
- How get get list of pages in ajax search
- Blank Pages with # URL & Google
- Displaying Subpages while on Parent page?
- Getting to a specific page on website using specific code instead of navigation bar
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Removing Parent Page URL While Keeping the Navigation Intact
- Search child pages from a specific page parent
- How to change the order of the Front Page so it doesn’t appear first
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- Ordering Pages and Increasing Navigation
- Add Filter to Ignore a Post/Page or a Number of Post/Pages
- Displaying Current Page Number Conditionally
- Static Website No Titles But Still Nav
- Search results to be only posts & children of page ID
- Search anything from a Child and Sub-Pages of their Parent page
- Make Audio Element Persistent Across Pages
- wordpress page navigation numeric pagination showing same posts on each navigation
- Add pagination to search.php page
- Search Page: activate html code if the tag is on the page
- How to make page navigation just below the content?
- displaying child pages in columns when on a parent page
- If searched in a category show different 404 page
- Search page different title per results
- search page different results
- simple category search form returns full text – but I need excerpts
- Advanced Multi Tier Navigation across columns
- WP-navi plugin and post sorted alphabetically
- How to enable automatic search results in WordPress
- Save search criteria per user and show on custom user page
- How to get current page ID outside the loop?
- featured image as background image on pages
- Can I display submenus in groups, using wp_list_pages?
- Order by menu_order and title?
- WP Page and Subdirectory with same name
- Can I display the widget admin in the page admin?
- How to inject custom url path for page ?
- How to display page title+link of page created by user
- Modify theme to get page excerpts on front page
- get_page_by_title not working when used with a variable
- How to disable Page Attributes dropdown in wp-admin
- How to make certain page templates visible to admin only
- Editing Pages that Have Already Been Published
- What is the proper way to get contents of a page?
- Getting child content
- Clean URL link for page without number
- How can I have two content titles?
- Get the Page Content,without generating HTML
- How can I split long posts into pages?
- Making a wordpress page the index on the site?
- Using Pages to handle calls for custom post types
- Guest authors, sort of like Wikipedia, but more theme-able
- Pages views limit [closed]
- Redirect to page list when page published
- Having wordpress page accesss issue under sub-directory
- How to make my category archive behave like a page
- Add external css to Contact Page
- Role can edit just one page [closed]
- how to edit source code of specific page in wordpress?
- Cannot enter “::before” for li tag when editing a WordPress page
- How to get page_id for url rewrite or how to use page slug for calling a page?
- JQuery Plugins in WordPress
- Dynamic href link to Contact Page
- Restrict the list of parent pages to only those which are created by current user
- how can i remove page title on desktop view
- Is there a way to schedule changes to a page?
- Option for pages order in backend
- Return subpages of an author if the parent page was published by an other author
- Allow a user to edit their own page and profile only
- Custom folder for wordpress page templates
- Separate URL for a specific page
- Pages that don’t look like blog posts?
- Next and Previous Page links based on ‘Order’ attribute
- Create multiple pages with tables from json file
- Update Pages ONLY from Stage to Live (not products)
- Every change made by “Author” role is going to “pending review”
- Groping Pages Per Department Option
- WordPress default theme cannot get full page on entry content div
- Create multiple custom HTML pages
- Add homepage to the list of pages in the Footer Widget
- How to remove the duplicate title tags and duplicate meta descriptions?
- Include images from pages in wp search.php results in default wp search
- Two different layouts for the same post
- My page title turns into a h2 tag – What to do?
- How to turn post into pages and via versa?
- Content not displaying on page
- Featured Image not displaying in a page
- Display child pages on homepage template
- Set order acs and no paging for archive page
- Naming custom page templates
- How can I use Page editor for two separate templates?
- Sort the data in WordPress using get-page-by-title
- Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages
- In WP, Google map error initMap is not a function [closed]