admin管理员组文章数量:1392110
I created a custom page to show data from the DB for an intranet site I have created. I used the following
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
get_header();
I read this in the documentation to get my menus and header to show. (makes sense)
The issue is that it is showing in the title bar "page not found". The content loads and everything looks fine other than that.
Anyone have any fixes for this?
I created a custom page to show data from the DB for an intranet site I have created. I used the following
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
get_header();
I read this in the documentation to get my menus and header to show. (makes sense)
The issue is that it is showing in the title bar "page not found". The content loads and everything looks fine other than that.
Anyone have any fixes for this?
Share Improve this question asked Feb 3, 2020 at 22:17 ellucidoneellucidone 11 bronze badge 3- 1 Why not create this as a WP Page? It would be easier than just using an orphaned PHP file and then trying to include things from there. You could create a custom Page Template if you're wanting a different layout than the standard. – WebElaine Commented Feb 3, 2020 at 22:35
- @WebElaine I have tried adding my custom PHP script to a page but it does not come out looking correct. Any ideas? Suggestions? – ellucidone Commented Feb 3, 2020 at 22:37
- 3 I figured out whaqt you meant. This works great. I created a page inside my theme and then selected that as a template. Thank you – ellucidone Commented Feb 3, 2020 at 22:48
1 Answer
Reset to default 0ok so I figured this out. Here are the steps I took
Create a php file in your themes directory
wordpress Dir -> Themes -> YOUR THEME NAME -> newfile.php
In this file add the following:
<?php /* Template Name: theme-child */ ?>
<?php get_header(); ?>
// your custom script here
<?php get_footer(); ?>
**Then go to Pages -> New Page
Within the new page on the sidebar select template and look for your template name that you defined in the top of the custom file.
Name and publish your page. Viola you should have a live page with your custom code in it.
本文标签: wp headCustom page with WP Header showing Page not found title
版权声明:本文标题:wp head - Custom page with WP Header showing Page not found title 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744780347a2624671.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论