To determine the best filter to use, you have to determine what those pages are. Is is_page()
true? Use the page_template
filter. Is is_post_type_archive()
true? Use the archive_template
filter.
All of the query type-specific template filters are listed here.
You can also use the generic template_include
, which fires for all types.
Within any of these filters you can check the same conditions you need to determine if you need to load the template-gallery.php
template.
Related Posts:
- Setting a custom sub-path for blog without using pages?
- Add Content to Page without shortcodes
- Loading custom page template via plugin
- How to quickly switch custom post type singular template?
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Help with CPT template pagination
- Create Template for Custom Post Type same like for Page
- Filter widget outputs
- Custom post type pages return 404 page?
- How to get the current category with custom posts
- Custom permalink structure for remote content pages
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- A certain theme is forcing it’s singular post layout
- Question on templates
- Custom post type option page template
- How can I load Template file from wordpress plugin
- How can I find out what template is my custom post type using?
- Custom Homepage As Single Page or Custom Post Type?
- Using custom post types within a section of a template
- Custom Post Type Template Based on Page Slug?
- using a template for more then 1 page
- display different template based on post type
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- How to set a fall back template for a custom post type in a plugin?
- Post formats “audio” and “video” only showing in index.php
- How to list/show all custom post types regardless of category?
- Add a Template to a custom post type
- WordPress calls archive page instead of Custom Page Template
- How do I Make a custom post type get a custom post template in a plugin
- Dynamic page.php template for custom post types
- Custom Post Type with Nested Taxonomy and Template Files
- Pagination on a custom page template
- Create Pages from Database
- Custom post type loops with different page templates
- Multiple templates for custom post type
- Include different loop templates in search query
- How to make an archive page displaying posts in a date range
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- CPT: archive-cpt.php VS custom page template
- Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template
- Custom Blog Post Listing in Genesis Sample Child Theme
- Multiple templates for a custom post type
- Troubles with making a custom template for posts
- Change archive page template using pre_get_post
- Query with no terms uses index.php template instead of archive.php
- WordPress Custom Post Type Children Template
- Getting template_include to work when allow_url_include is off?
- redirect automatic page that serves custom posttype content
- WordPress showing archive.php instead page
- How to create a gallery page with categories?
- Why does my content disapear when I make a page to match an archive name?
- Fields for different parts of a page
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- How can I set the page template of a new custom post type post?
- WordPress 3.9 not using custom template
- How to Create Template File for Parent Page of Custom Post Type
- how to remove pages loading with the archive templates
- WordPress Picks Up Wrong Template for Custom Post Type Archive Page
- get comments by current user inside page template
- Creating separate feeds for custom post types
- How to get_term_meta on single custom post?
- How do I find a way to create a global single.php for a custom post type?
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Dynamic assign a custom template to custom post type posts
- Assign a template to a custom post type when displayed by the main loop on the home page
- How to add page under a custom post type?
- How to create a archive template for custom post type [duplicate]
- Tag template not returning posts [closed]
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Conflict in function to allow single post template based on category
- How to make post templates to include shortcodes only?
- How To Display Posts Of Custom Post Type At Page Template
- How do I find out which (page) template file my custom child post is looking for?
- Feature image Gallery made from Custom Post type + Categories
- Custom Post Taxonomy Template Not Loading Properly
- How can I use one instance of page.php to display different custom post types?
- Turning archive templates to a page template maintaining the slug
- Templating advice sub posts of a CTP
- get_permalink() of page the enclosing page not posts
- How to Create a Default Fixed Custom Posts layout for text and images
- Custom post type , page template not grabbing the page template
- Can I organise my custom post types by page?
- Why did permalinks setting affect the pages?
- custom post type plugin – single template
- custom post type archive slug vs. custom page template
- How can I detect a chosen Isotope layout option from within Javascript to generate appropriate layout?
- How can i embbed two different galleries in custom post type
- How to create a custom template for this custom post type?
- How to divide posts (custom post type) content on multiple pages?
- Is it possible to create a separate page for custom posts gallery?
- create gallery page for specific post id
- Page template anomaly
- How to make a template for a specific post of a custom post type?
- WP_Query is getting the post but the_post() not rendering any Post
- Get images only from a certain post type
- Slideshow/Gallery plugin based on WP Core Gallery [closed]
- Custom post type is_singular condtional not working when managing sidebar display
- I want to show a list of posts under specified categories