1

This question already has an answer here:

Sorry for my simple question, but I don't know how to explain it right so google won't help me. Therefore I try here to get a answer.

So.. i use the front-page.php in my theme as startpage. I know that the index.php is used for all pages which have not set a file.php.

My question is: Which code goes in the index.php? The same I used for the front-page.php? Is this useful?

My current theme structure:

enter image description here

marked as duplicate by birgire, Howdy_McGee, Pieter Goosen, Sisir, cybmeta Feb 1 '16 at 13:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Please go through this template-hierarchy – Webloper Jan 22 '16 at 16:52
  • Its clear to me that wordpress go through the hierarchy until wordpress reach the index.php... That was not my question, my question is what code is useful to put in the index.php. – lacepace Jan 22 '16 at 17:02
  • 1
    If you handle all possible templates on WP then your index.php can be just an empty file. – Sisir Jan 31 '16 at 11:09
0

Below is a link to a very good Tutorial made by LearnWebCode on YouTube that teaches you how to make your own WordPress Theme as well as explains what each individual page does and the purpose of the .php file . It's what I watched when I first started off making my own WordPress Themes.

WordPress Theme Development - Tutorial

Regarding your question however - there are many different things you can put in the index.php file it all depends on how many other .php files you have.

Good luck,
Stephen :)

  • Thank you! Its not my first tutorial but I will watch it for sure, maybe I can find something interesting. As you can see i posted my file structure. Overall this is my theme, at the moment there are missing some page-ABC.php to allow to add a custom page content and maybe the basic file like 404 but otherwise that's it. – lacepace Jan 22 '16 at 17:27
  • His tutorials explains most things although it is not extremly in-depth you'll understand what to put inside the index.php and so on... I'm not currently at my computer but when I get on it I will show you what I have inside my index.php along with all the different .php files I have – Stephen Jan 22 '16 at 17:30
  • Maybe i have to say that i use wordpress as CMS and not as blogging system. Thank you for your efforts – lacepace Jan 22 '16 at 17:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.