No, the index.php will still be used, but the single.php will take its place for single post pages.
Read more on this subject here:
http://codex.wordpress.org/Template_Hierarchy
WordPress looks for template files with specific names in the current Theme’s directory and uses the first matching template file listed under the appropriate query section below.
Doesn’t this mean that the ‘first matching template’ replaces all the other ones?
Yes, but only for that specific case.
Look at the hierarchy. A single.php file is only used for single-post pages. Not for root pages, or archive pages, or category pages…
See here for graphical example:
http://codex.wordpress.org/images/1/1d/wp_Template_Hierarchy.png
Ok, so single.php will be used(inplace of index.php) when the page contains only a single post. Otherwise, index.php will be used. Am I getting it now?
Ok, so single.php will be used(inplace of index.php) when the page contains only a single post. Otherwise, index.php will be used.
If you don’t have a single.php file in your theme folder – WP will use index.php to display the single post view, too.
For all the other views (monthly or category archives, Pages, search etc.) WP looks for the template files exactly as it is described in the Codex article for each case.
Index.php is the general “fall back” in case there is no specific template for the case.
Thanks. I think I understand now
Ah.. I’m glad I found this post. Makes sense now.
My problem is that I have multiple posts showing up on my single.php. What am I missing?