i created a custom Theme in WordPress and everything is working fine and the CSS is loading to my index.php. So now i copy-pasted the index.php and renamed it, then i went to the indexCopy site and the CSS wont load. In the Code, everything is the sam, except the fileName. When i go back to my index.php, the css IS working. Do you need Code examples for this issue?
What am i doing wrong ?
i created a custom Theme in WordPress and everything is working fine and the CSS is loading to my index.php. So now i copy-pasted the index.php and renamed it, then i went to the indexCopy site and the CSS wont load. In the Code, everything is the sam, except the fileName. When i go back to my index.php, the css IS working. Do you need Code examples for this issue?
What am i doing wrong ?
Share Improve this question asked Mar 25, 2020 at 9:37 yama_HDyama_HD 1112 bronze badges 2- Is this a WordPress site? I don’t understand what “went to the indexCopy site” means? How are you doing that? – Jacob Peattie Commented Mar 25, 2020 at 9:43
- I am pressing a button on my "Main WordPress Page" then i got redirected to my copied index.php file and then, the css wont work. – yama_HD Commented Mar 25, 2020 at 9:54
1 Answer
Reset to default 0Sounds like your are not creating a proper WordPress template when you copy your index.php.
Here you can find the list of standard template files: https://codex.wordpress/Theme_Development#id=%22Template_Files_List%22
And here you can learn how to create a custom template: https://codex.wordpress/Theme_Development#Custom_Page_Templates
My guess is you need to add the following to the top of your index copy. Then make sure to select this template from the edit post/page view to use it on the front end (it should use the css).
<?php
/*
Template Name: Index Copy
*/