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
- How to make a WP_Query search with custom post types?
- tag.php doesn’t work with tags on a custom post type post?
- Assign single template to multiple custom post types?
- How do I Paginate Search Results for Custom Post Types?
- Add Content to Page without shortcodes
- WordPress post sorting with AJAX
- Why have my custom post type searches stopped working after changing URLs / updating WordPress?
- Search that will look in custom field, post title and post content
- Returning search results by relevance, including Custom Post Types
- How to replicate some of Drupal Views functionality in WordPress?
- Custom taxonomy query for a custom post type
- Seperating Custom Post Search Results
- Exclude from search all custom posts which are NOT in a taxonomy term
- Exclude a term of a taxonomy with a custom post type in a search
- Need some templating advice for templating with custom post types and taxonomies
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Custom Post Types: pretty search URLs and has_archive
- Template tags to display custom post type posts in category template?
- How do I create new content pages for my Custom Post Type?
- Display posts of child category in template
- custom taxonomy – Template not working
- No results searching custom post type in admin panel
- Create separate template for shared custom taxonomy with shared terms
- Custom Post Type Templates?
- wordpress 3.4 template files in subdirectories
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- How do I provide a “show all posts” link in a paginated term archive?
- error in Advanced Search Form for Custom Post Types in WordPress array_key_exists() expects parameter 2to be array, string given
- Search Custom Post Type Custom Fields
- Custom Post Type not appearing in website search
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- Help with CPT template pagination
- Merge multiple custom post types in a single archive template
- Trying to edit the single page from a Custom Post
- Custom search for custom post meta with pre_get_posts interferes with WP search
- WooCommerce product search titles only
- Using wordpress template tags within an array
- Custom Post Type template stored in plugin folder not showing in post attributes dropdown
- I did group my search results by post type, but how can i give each of them its own order?
- How to clone the “Projects” Custom Post type in Divi theme
- custom post type Search returns No Results in admin panel
- Search Custom Post Type & Taxonomies
- filter custom post type by meta key in dashboard
- WordPress sort search results by custom order
- How to use custom template files in deeper directory?
- filter search custom field query
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- Custom posts template page
- Custom filter for main search: how to exclude specific post_type from search results
- Add Previous/Next Buttons to CPT Single Pages Only
- Add custom attributes to a post
- how to get this tax_query working?
- 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
- How do I find a way to create a global single.php for a custom post type?
- Templates for hierarchical custom post type
- Apply template by path/slug related to custom post type?
- How to get the current category with custom posts
- Ideas on how to organize a project [closed]
- How to create a archive template for custom post type [duplicate]
- WP not recognizing custom post type / template
- Create a custom taxonomy template that loops through child categories in term order?
- My template won’t apply, theme still fallback to index.php
- One Custom Post Type two different Templates
- On click some element i want to use some template
- How to Implement Search Functionality?
- Change search query in wordpress custom post type
- Post template with breadcrumb needs to show page navigated from
- Create a post automatically if search result has zero results
- Accessing download link from the loop with WP Download Manager Pro
- Turning archive templates to a page template maintaining the slug
- get_permalink() of page the enclosing page not posts
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- Why did permalinks setting affect the pages?
- How to make a custom search template for custom taxonomy?
- Custom post type with two templates
- Custom Post Type tag taxonomy “Page Not Found”
- DIVs not showing correctly on CPT?
- Search form to find custom meta box generated data
- 404 error Custom search results page for custom post types with friendly URL
- multiple custom post type category selection search
- Custom Search Template for Custom Post Types
- Load different template for CPT (in loop) in my plugin?
- Custom Post Type Template based on Taxonomy
- Template with Custom Post Type (Custom Tables) does not work
- Archive custom template from search
- Customising wordpress search and using $_GET[“s”]
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- how to pass args for archive.php query?
- Navigation links to posts in current term shortcode
- CPT Template Option to Top
- Show my custom post id if a country or ip
- How to create custom page templates with default page layout framework?
- Custom post type is_singular condtional not working when managing sidebar display