最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - Custom CSS File wont work on second Page

programmeradmin0浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

Sounds 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
*/
发布评论

评论列表(0)

  1. 暂无评论