Pete Winter
asked on
wordpress theme creation
I am creating a theme.
I want the contents of the home page to be a static php file with a dynamic header and footer, then all other pages grab the contents from the relevant wordpress page.
I understand I need a index.php file in my theme, but a little unsure on the structure.
Can my index file say if this is the home page view the home.php template file, then for all other pages use the page.php file.
Can you please show me the basics for setting this up.?
I want the contents of the home page to be a static php file with a dynamic header and footer, then all other pages grab the contents from the relevant wordpress page.
I understand I need a index.php file in my theme, but a little unsure on the structure.
Can my index file say if this is the home page view the home.php template file, then for all other pages use the page.php file.
Can you please show me the basics for setting this up.?
ASKER
So shall I just leave the index.php file blank?
Do I just put home page contents in home.php
then contents for all other pages with the loop in page.php ?
Do I just put home page contents in home.php
then contents for all other pages with the loop in page.php ?
None of the above. To create a Wordpress theme, you really need to read that article, probably several times. My current Wordpress 4.2.5 installation is 19 MegaBytes with 1601 files in 150 directories. Wordpress is a very complicated application and you should be working only on the parts in the 'themes' directory.
When I have needed a 'new theme', I have just copied the stock theme and modified it. That leaves about 95% of Wordpress un-modified.
When I have needed a 'new theme', I have just copied the stock theme and modified it. That leaves about 95% of Wordpress un-modified.
ASKER
Yes I understand creating the theme folder and location and the style.css, etc.
I am just trying to understand the main difference between the index.php and home.php files. Currently my index.php is blank and I have everything in the home.php for the home page, but I assume I need to tell wordpress to use home.php for my home page, then page.php for every other page. Do I need to do that in the index.php file?
I am just trying to understand the main difference between the index.php and home.php files. Currently my index.php is blank and I have everything in the home.php for the home page, but I assume I need to tell wordpress to use home.php for my home page, then page.php for every other page. Do I need to do that in the index.php file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. I have worked out what I am doing wrong. Thanks for your advice.
You're welcome. Good luck with your project.
This is a view of my Wordpress installation directories. Your 'theme' would go in the 'themes' directories under 'wp-content'.