I am working in AMPPS on a wordpress theme (on a Mac OS). While working on the pages.php file, I made some changes and saw no effect. As a test, I temporarily deleted all code in the file and saved it. For some reason, the link ISN'T broken...it loads the page as if the code was all there. So I tried to trash the file, and now a nonexistent page is loading. It loads page.php even though the file isn't even in the theme's folder. I've tried clearing my cache, restarting the browser, even using a different browser. Nothing works...the page keeps loading as if frozen with some very specific exact code. It's acting like it's a cached file, but I've even disabled cache under developer tools (in Chrome). That wouldn't explain why it's loading in Firefox anyway.
What could be causing this and how do I fix it? It seems I'm not seeing ANY changes that are made to that page.php file... no changes in HTML and no changes even if the file is trashed or all the code is deleted. Is this an apache cache? (I never set one up).
This has got to be a cache somewhere...right? Not sure how to fix it?
答案 0 :(得分:0)
取决于您的主题。如果没有page.php文件,Wordpress将默认为index.php。如果禁用所有缓存插件,我认为缓存不是一个因素。可以帮助您解决这个问题的一件事是将以下代码行添加到page.php,index.php和您拥有的任何其他页面模板(single.php,archive.php等)。
<?php echo __FILE__; ?>
答案 1 :(得分:0)
我解决了这个问题。显然,Wordpress正在从single.php获取信息并使用它。我对single.php所做的任何更改都会生效。一旦我删除了single.php,然后Wordpress就开始从pages.php
中提取代码