index.php
is shown whenever wordpress doesn’t find an appropriate page template. Generally people use it as the template for their site’s blog. If you are absolutely sure that it will never be reached, you can leave it empty. Just make sure you have that file present, otherwise the theme will not work
As a personal preference, when coming across this kind of situation, i just rename one of archive.php
or home.php
to index.php
which will work just as well for almost all of the situations
Related Posts:
- Loading partial templates with AJAX/PJAX
- Templates & CSS – Proper Programming Practice?
- index.php template is used instead of blog page
- Load template file without a post type
- How to apply a custom template for posts by default?
- Unable to include a template
- When a link doesn’t exist, how to tell WordPress what to do? (404 Error Page)
- Is there a way to set different post templates for parent posts and child posts in the same post type?
- Having trouble with Template hierarchy. I Need to create a set of pages that drill down from states to specific locations
- Custom templates vs page-slug
- Understanding the Template hierarchy
- How does WordPress choose archive type template?
- Use one template only for custom post type archives?
- get_month_link uses what wordpress template?
- Differentiation between index.php and page.php
- Single-page.php template file name not shown
- Can I assign a Folder for Post Formats, without it affecting WordPress’ fallback/hierarchical system?
- How to display custom post type?
- Assigning custom page templates to a static blog page
- Archive-custome_post.php template not working
- Organize template parts and page templates in folders in regards of template hierarchy
- Help Understanding Template Hierarchy
- User role templates
- Assign template to custom page type?
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- How can I make custom page templates work on child theme?
- Which template(s) to override to use a different sidebar for blog, single posts, categories, blog archive?
- Single Post Templates Doubt
- Page Templates Used in Custom Post Type
- Show a custom template, no matter the page being viewed, if the user is not logged in
- Unload templates; disable parent Template Parts using only “theme.json”
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- Is there a way to list all used/unused WP templates?
- Change the name of the ‘Default Template’
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- Template files missing after moving site
- Grid layout “last” class to every third item
- Using “setup_postdata” with “get_template_part” does not work
- How can I get the content of the home page?
- Why aren’t my posts showing?
- WordPress Template Hierarchy
- How to display error on specific template?
- How to move style from template file to section?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- Calling an image within the theme folder from inside a post/page?
- Display “large” image size and show caption in attachment page
- How to delete read more span on single post view?
- WordPress editable template fields
- Conditionally display different images before the content in a page template
- Show all parts in multipage post
- Why are 404s not triggering my 404.php template?
- How do I create a custom archive page depending on the custom taxonomy type?
- Is there a way to create a block template that is not limited to a post type?
- All top-level pages are using index.php as template
- Can’t format content of Rich Text Editor in Template
- get_file_data to read data for Custom Template File?
- How to publish a Page and Posts using single template
- What is the best practice to style archive page 2,3,etc differently than archive.php?
- How to create a post template with two sidebars
- != and !== both not always working? [closed]
- Page template for a site from network
- WordPress 3.3.1 single post template
- Prevent 404 and serve custom template for custom URL
- Add stylesheet per layout
- use a custom page to display search results
- When a user registers, create a page from an existing template with their username as the page name
- Theme settings Page: Settings Api vs Update_Options
- How to add description over forum list on bbpress root page
- two active templates for one post
- Where is the code for “Front Page Template”?
- what is template-name.php
- templates with page teasers Or Featured Items
- If Child or Grandchild of Page
- Is it possible to create custom links inside a template?
- How do I custom a page that doesn’t exist in the page list?
- Uncaught Error: Call to undefined function twentytwenty_the_post_meta()
- Timber + MtHaml, or any other HAML-like HTML shorthand
- How to configure my blog page
- Archive only for /year/month, not terms
- More than one search results page template for two searches on site
- Why default template does not show?
- Different templates for each category level
- Why would adding a template file to a child theme cause an error in template-loader.php?
- How can I add some blocks to template without changing template file?
- Creating a popup
- WordPress not picking up custom templates in sub directory
- Category template not displaying all post formats
- Is it possible to call a template file inside wysiwyg editor? And how?
- Retrieving post ID from current page
- Mysterious template change after database import/export
- Is there a way to share a template/markup with the JSON API so that it doesn’t need to be declared both in PHP and in JS?
- Styling own template
- changes to templates not showing on server
- Problem with permalink structure for WordPress custom post_type archive template
- Template files not working for archives and categories
- Make default template two columns?
- Read more button not working
- pass dynamic value to page to pull in categorised post cards
- templates page not showing on gutenberg editor