As per comments: if you want all pages to redirect to the index.php template anyway, it’s not necessary to put redirects in templates like page.php and single.php. You can simply remove those templates and the template hierarchy will handle it for you.
Related Posts:
- Is it possible to manipulate the list of page templates?
- How to Handle CSS for Multiple Header header.php Files?
- Static Front Page problem
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- WordPress Theme Development: How to redirect templates the right way?
- Override template file i subfolders
- add jquery file if a certain page is included
- How to link to the page displayed by home.php?
- which template should I use for single category post?
- Different templates for each category level
- What is the point of using archive.php instead of index.php?
- What is the preferred way to add custom javascript files to the site?
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- theme path in javascript file
- What’s the difference between home.php and index.php?
- pass object/JSON to wp_localize_script
- Solutions for generating dynamic javascript / CSS
- Custom single template for a specific category
- How to insert a logo in the header?
- How to move page templates to custom folder?
- Proper, exhaustive documentation for wp.editor etc
- Page template in two level deep folder
- Create “File-less” Page Template in Functions.php
- Any alternate TinyMCE4 themes / subthemes?
- Different wordpress 404 template for different post type [duplicate]
- Is there a way to set the order of wp_footer hooked functions?
- How does WordPress decide what template to use as frontpage
- Google Maps not displaying in wordpress using Google Maps Javascript API
- Trigger Customizer saving process with Javascript only
- How can I get wp_head() as a string instead of echoing it?
- Why does my short code get executed before other content?
- Retrieve the template directory URI via global or get_template_directory_uri() every time?
- How can I see what template parts are being called for rendering the viewable page?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Add a preview to a WordPress Control Panel
- Add a #hash to the links in my custom menu
- Problems with Layout inherit in theme.json
- LOST in WP Template Hireachy
- How to load different CSS in different Header?
- Changing the entire control choices using wp.customize with JavaScript
- How to Change CSS Variable value in Theme Customizer Live Preview
- Template Hierarchy for get_header()
- Returning Variables back into a template
- Can not Remove Archives and Meta from Sidebar
- Modifying JS files in Child-theme
- How to override BuddyPress 3.0 bp-nouveau theme files?
- is_archive() content being shown instead of is_category()
- Setting hero/splash section as a blog post
- Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- WordPress Customizer Control with React
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- How can a Theme Contain no Header File or Footer File?
- How to configure wordpress to work with Vuejs with SSR and without hashbang
- How do I update WooCommerce template files in my theme? [closed]
- How to hook CSS file according to theme selection in the customizer section
- New template, where to place CSS?
- Understanding the WordPress template hierarchy
- How to correctly add JQuery in a WP theme?
- Check if password protected post is visible
- get_query_var() and permalinks
- using wordpress without javascript
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- 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?
- Theme development question regarding layouts
- Including Javascript options
- Why are theme templates organized as multiple point of entry PHP files instead of reusing your theme’s index.php?
- Disable front-page.php template
- How do I create a custom partial / template?
- Change the template of multiple multisite pages at the same time
- Simple way to get two language WP site
- Load child template based on parent
- JavaScript Change focus to password field login page being reset
- create-guten-block in wordpress theme?
- Inheritance of parent theme plugin files in a child theme
- jQuery not available to other scripts
- Single Page theme [closed]
- How to make Isotope and WordPress work together?
- 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
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- How to add material design css in wordpress and woocommerce
- Use second time navigation.js in underscores [closed]
- Sort wp_query by sum of two meta fields
- Theme Javascript.php Overwritten Nightly [closed]
- How to override p2 breathe theme plugin in content template file?
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- Move default page templates to sub directory
- How to get javascript slider to work! [closed]
- What can I use for small text when converting to WordPress?
- WordPress Filtering Custom Post Type by Metadata and Search Heirachy
- Theme Customizer not loading JS for live preview
- Where to place template files?
- How can I conditionally show different home page templates based on whether or not the user is logged in?
- My jQuery is enqueued properly. So why isn’t it working?
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?