There is a filter called theme_page_templates
which you can use to force the use of a certain template under certain circumstances. Like this:
add_filter ('theme_page_templates', 'wpse263827_filter_theme_page_templates', 20, 3 );
wpse263827_filter_theme_page_templates ($page_templates, $this, $post) {
if (condition based on $post) $page_templates="path-to-template.php";
return $page_templates;
}
So, you can place the template file wherever you want and assign it when the page is in that certain category. No need to touch the url structure.
Related Posts:
- Why are theme templates organized as multiple point of entry PHP files instead of reusing your theme’s index.php?
- Replace single_template filter with what for default posts?
- What’s the difference between home.php and index.php?
- Custom single template for a specific category
- How to remove search bar from a wordpress theme? [closed]
- What filters are applied to the_content function?
- Change admin bar to default:off
- How to modify an image block in Gutenberg WordPress 5?
- How to move page templates to custom folder?
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- Is it possible to manipulate the list of page templates?
- Template for individual post designs
- wp_get_attachment_image_attributes not working for me
- How does WordPress decide what template to use as frontpage
- How can I get wp_head() as a string instead of echoing it?
- Display a different theme for not logged-in users
- Why does my short code get executed before other content?
- How can I see what template parts are being called for rendering the viewable page?
- Add a preview to a WordPress Control Panel
- How to Auto Approve Comments on a Specific Page?
- How to Handle CSS for Multiple Header header.php Files?
- Static Front Page problem
- Passing variable in hooks and filter
- Returning Variables back into a template
- Can not Remove Archives and Meta from Sidebar
- How to override BuddyPress 3.0 bp-nouveau theme files?
- Setting hero/splash section as a blog post
- WordPress nav_menu_css_class theme filter is not being called
- Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?
- customizing the_password_form filter
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Change file name from wp_generate_attachment_metadata
- New template, where to place CSS?
- get_query_var() and permalinks
- Toggle Sidebar Display
- Add theme templates for child categories into the template hierarchy
- Move theme templates to subfolder without losing page associations
- Where can I access my custom page template?
- How do I create a custom partial / template?
- Simple way to get two language WP site
- Load child template based on parent
- Highlight “Show all” item in wp_list_categories
- create-guten-block in wordpress theme?
- Override template file i subfolders
- Single Page theme [closed]
- Should I use add_filter for functions in function.php of the theme?
- Do i need to keep all the default WP templates files in a theme?
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- how to display search term in the template full site editor
- Catagories to the list of the titles in that catagory to the content of the post [closed]
- Sort wp_query by sum of two meta fields
- How to override p2 breathe theme plugin in content template file?
- WordPress taxonomy and archive custom class
- What can I use for small text when converting to WordPress?
- Filter categories used with Custom Structure Permalink
- How to wrap all titles generated by Gutenberg “Heading” block with tag
- Template for landing pages
- How to seperate static phrases from template files in custom theme?
- How to disable thumbnail filter for a specific template part or image size?
- Post and page content not displaying in search results
- Why still output /wp-content/themes/twentynineteen?
- Templates dropdown not appearing using _s theme (underscores)
- Shortcode call not working in WP Template
- tiny_mce_before_init: ‘exact’ => true has no effect
- Create theme for mobile phones and tablets only?
- I need to develop a one-page design
- add jquery file if a certain page is included
- How to create a WP theme that use BootStrap? [closed]
- How to conditionally add a wp_filter
- How to set default values for edit_post_link() in my theme?
- Tiny MCE custom styles, and preview in the backend
- content filter (add_filter) for category description?
- Is there a template tag I can use to link to the archive page corresponding to the month that a post was published on?
- How to register dynamic settings in WordPress Customizer?
- How to Modify WP_Includes/blocks/latest_posts.php
- How to implement pagination in category.php template
- WordPress wp_get_current_user returning blank values until refresh
- Alternative solution for script_loader_tag?
- Using wp_add_inline_style Inside a Template File
- Should I use template files or just use conditional tags in index.php?
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- Make a custom field in admin post.php read only
- Display content on Single page
- How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags
- Create a variable with string, array or multiple values
- How to manipulate wordpress template tags’ output
- what is do_action(); in wordpress? [duplicate]
- How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?
- WordPress Footer Widget Processing
- Problem with multiple menus in theme
- Suppress the_content filter in a nested loop
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- apply_filters to featured image
- What is the advantage of using home.php over index.php for the front page
- Add rel to all images in a post
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- HTML to WORDPRESS [closed]
- What is the point of using the front-page.php template? [closed]
- What is the point of using archive.php instead of index.php?
- Theme template file for a specific custom taxonomy