How to add a php file to wordpress theme addition of standard files?

白昼怎懂夜的黑 提交于 2019-12-12 00:16:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!