I'm trying to find out why any template different than index.php doesn't work.
I've created a category-news.php file (also tried with category-4.php and mostly all alternatives), but when opening this url, I see a white page and checking the source code, I see the php code as HTML comments.
Any idea to what could cause that?
I've checked the functions.php (that has been written by me) and there are no places that does that. As for plugins, disabling all of them doesn't help.
UPDATE - More information about the template page, as per request in comments
You can find the category-news.php source code here. You were right: I was only checking with Google's developer tools and there I see the php code changed as HTML comments. When looking at the actual HTML code, I only see the original php code. Either way, this shouldn't happen and since the rest of the theme works as expected, I think there must be something wrong with the file itself. As for the encoding, I always use phpStorm and never changed a single setting on it (at least for what concerns file encoding). Actually I don't even now how to check/change the encoding from phpStorm and any text editor I'm using (TextWrangler, Espresso, or TextEdit) doesn't have this option (I'm on a Mac).
category-news.php
?/category/news
) is passed to WordPress' index.php. WordPress willinclude()
files to generate the page, includingcategory-news.php
. If the content of the file is printing to the page, then you have something else happening on the server. Perhaps an encoding issue, another PHP file that's printing output rather than running it, etc. But there are no HTML comments here, and unless you're doing something else on the site there's no way that URL would produce that output on a standard installation.