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
- Custom taxonomy returns 404
- Show Custom Post Type meta boxes only on Page Edit
- Adding the_content() in custom template email
- Creating a Page Template to display all items from a Custom Post Type
- Why does my content disapear when I make a page to match an archive name?
- Adding Page Templates to post but it ignored it
- Template for all categories of a custom post type?
- Custom Post Type Template Alternative
- Migrating a taxonomy’s tags to the native category
- General advice on addressing content-centric pages
- Flush Rewrite Rules when new site is created on network
- Fields for different parts of a page
- next_/previous_post_link() `in_same_category` appears to fail when true
- Multiple templates for single custom post type
- Can anyone help me with galleries and post types?
- WordPress custom taxonomy template not working
- How do you create a custom template to display a category with an image and related posts below?
- WordPress Custom Search by post_type
- How can I get this request to use the Custom Post Type page template instead?
- 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
- Pages Become “Archive” Instead of Using Page Template
- How can I set the page template of a new custom post type post?
- How to add multiple images to a custom post type without plugin [closed]
- WordPress 3.9 not using custom template
- Multiple single templates?
- 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
- Creating my own portfolio custom-type
- Custom post_type search pages
- How can i link a custom post type thumbnail to intermediate size
- how to remove pages loading with the archive templates
- Custom URL redirect in WP
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- WordPress Picks Up Wrong Template for Custom Post Type Archive Page
- Associate page w/ specific single post template?
- Custom posts template page
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Editor / Add Media: Is it possible to only allow galleries?
- How can I use archive-{post_type}.php theme template?
- Include php on a specific page template
- get comments by current user inside page template
- page template for custom post type
- Page Template Dropdown For Custom Post Types
- make permalink go to a custom single.php file
- Add Previous/Next Buttons to CPT Single Pages Only
- Creating Sections for Post Types
- Custom post types with categories in template
- Creating separate feeds for custom post types
- Which file/template is in charge of taxonomies for custom post types?
- How can I trace inconsistency in loading a template?
- How to integrate single and archive templates for custom post type in any WordPress theme
- How to get_term_meta on single custom post?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- providing access to post_id or post inside functions.php
- 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
- wp_get_canonical_url showing first url of the post for custom page
- Custom page for editing custom post type on frontend based on url
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Custom Post Type setup
- Apply template by path/slug related to custom post type?
- Dynamic assign a custom template to custom post type posts
- assign different templates to custom post type with homepage loop
- Separate Content from gallery (custom post type)
- Custom post type is using the index.php template
- Assign a template to a custom post type when displayed by the main loop on the home page
- How do I display child post types in the parent post type template
- Get template part with CPT and Custom Taxonomy conditionals
- How to Organize and Sort Gallery of Images
- 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