问题
Wordpress themes have standard file such as header.php, footer.php, index.php, functions.php, style.css, ... How to add a php file to wordpress theme addition of standard files? for example I want add a news.php to display specific posts in it, please help me
回答1:
Just add a new file (e.g. news.php
), and put the template comment at the very beginning:
<?php
/*
Template Name: News Template
*/
Then, go to your Wordpress backend, create a new page, and select the template you created:

来源:https://stackoverflow.com/questions/12240471/how-to-add-a-php-file-to-wordpress-theme-addition-of-standard-files