How are you restricting the search to your custom post type? If you are doing it by passing an additional argument, i.e. &type=myCustomPostType, you could use a conditional test, like:
if(isset($_GET['type'] && $_GET['type'] == 'myCustomPostType')):
get_template_part('loop','youtube');
else:
get_template_part(loop);
endif;
Related Posts:
- Searching multiple custom post types and pages
- Include different loop templates in search query
- Custom Empty Results page for my Custom Post Type
- Search page for custom post type
- Auto Complete Search
- search suggest – filter post type
- Searching Custom Post Types
- Custom taxonomy returns 404
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- How do i search authors from search form using author’s name
- Template for all categories of a custom post type?
- Remotely search WordPress sites using xml-rpc
- Migrating a taxonomy’s tags to the native category
- Flush Rewrite Rules when new site is created on network
- BBPress Search results in WordPress search
- Limit Search to Post Type With Apostrophe return search not found
- Search filter triggered & sort by custom post type
- Set Custom Post Type in Widget Settings for use in Widget
- Displaying and searching Custom Posts
- Search by tag name and category
- Searching Custom Fields
- Advanced search form with filters for custom taxonomies
- WordPress custom taxonomy template not working
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- filter search custom field query
- Different results between permalink and query var search
- How to let users choose where to search for posts?
- WordPress Custom Search by post_type
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- Archive for a Taxonomy of a Custom Post type
- What content types are shown at a search page?
- Can NOT search my custom post type?
- Custom post type pages return 404 page?
- Search one custom post type ONLY, disable “all posts”
- WordPress 3.9 not using custom template
- Template files for Custom Post Type and Taxonomy
- Set templates for custom post types
- How to Create Template File for Parent Page of Custom Post Type
- Pagination Error : Duplicate argument being outputted
- how to remove pages loading with the archive templates
- WordPress search and date filter not working with custom post type
- Main query not querying any posts in custom taxonomy template
- Custom posts template page
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- How can I use archive-{post_type}.php theme template?
- Custom filter for main search: how to exclude specific post_type from search results
- make permalink go to a custom single.php file
- Add Previous/Next Buttons to CPT Single Pages Only
- Creating Sections for Post Types
- Add custom attributes to a post
- Custom post types with categories in template
- Display an icon based on post type
- Creating separate feeds for custom post types
- Which file/template is in charge of taxonomies for custom post types?
- how to get this tax_query working?
- How can I trace inconsistency in loading a template?
- Select2 AJAX and WP Query Returns ALL and does not filter
- Custom Taxonomy Search result page
- How to group search results by post type and only if post type result is not empty?
- find custom post type post by searching its custom field with my string
- search custom post type by custom fields on front end
- How to get_term_meta on single custom post?
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How do I find a way to create a global single.php for a custom post type?
- How do I assign a block template (.html) to a custom post type?
- Templates for hierarchical custom post type
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Custom Search | check multiple meta_value for search value
- Hide custom post type from search based on custom taxonomy
- Custom Post Type setup
- Apply template by path/slug related to custom post type?
- assign different templates to custom post type with homepage loop
- How to get the current category with custom posts
- Custom post type is using the index.php template
- What is the correct term for a tool that filters content based on metadata?
- Assign a template to a custom post type when displayed by the main loop on the home page
- Pagination on search results page
- Ideas on how to organize a project [closed]
- Get template part with CPT and Custom Taxonomy conditionals
- Template code to split a post and print a custom field?
- Displaying a list of Contacts
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- Best way to create a search for custom post type by custom field values
- Custom Post Type homepage template
- Filtering custom posts by custom fields (ACF) [closed]
- Searching post types
- Custom permalink structure for remote content pages
- Blank search results on custom search
- Multi Parameter search with custom post type category and tag
- Setting a homepage – doesn’t seem to work
- CPT, meta-data, url parameter
- Limit search field to just search a custom post type with custom fields
- How to create a archive template for custom post type [duplicate]