admin管理员组文章数量:1289525
When I use my php file as a template and no other content on the page, it works fine but when I run the file directly (via PhpStorm), there are missing elements (such as comment_status) that cause exceptions. I am doing the require of wp-load and calling get_header() within the file, but obviously something is still missing, that a 'real' WP page has. So - I'd like to see the Php from the otherwise 'blank' page, that WP uses. Viewing source of course only shows the final html.
<?php
/* Template Name: BlankPage */
require_once '..\wp-load.php';
get_header();
comments_template();
comment_form();
get_footer();
?>
When used as a template, the 'require' line is commented out. Via the WP page editor, I checked the 'allow comments' checkbox. Don't know how to do that yet, via the code.
本文标签: templatesHow can I get a single php file that is the equivalent of an existing WordPress page
版权声明:本文标题:templates - How can I get a single php file that is the equivalent of an existing WordPress page? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741436780a2378681.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论