我无法将标题页插入我的wordpress index.php页面。? #header.php 我的演示 通过

我无法将标题页插入我的wordpress index.php页面。? #header.php 我的演示 通过,wordpress,Wordpress,wordpress index.php不支持此页面。 我想在wordpress语法中包含我的头文件到wordpress index.php页面,这是在“主题”文件夹中的大多数页面中“加载”头文件的正常方式 你应该用这样的东西 # header.php <?php /** * The Header for our theme. * *Displays all of the <head> section and everything up till <div

wordpress index.php不支持此页面。
我想在wordpress语法中包含我的头文件到wordpress index.php页面

,这是在“主题”文件夹中的大多数页面中“加载”头文件的正常方式

你应该用这样的东西

# header.php 
  <?php
  /**
* The Header for our theme.
*
  *Displays all of the <head> section and everything up till
 <div id="inner_header">
  **/
 ?>

 <div id="inner_header">
     <div id="templatemo_site_title">MY DEMO WESITE</div>
       <div id="templatemo_site_slogan">    <a href="#" target="_parent">Website Templates</a> by     </div>
   </div>

函数get_header()通常加载header.php文件,您将在其中放置所有内容

--

如果要在外部文件或文件夹中加载WordPress标题,则需要加载函数wp\u load(),在该函数中可以找到WordPress文件夹的根目录

    <?php
/**
 * Template Name: Front Page Template
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */

get_header(); ?>


希望我理解了你的问题。

你的
标题。php
应该有一个有效的HTML文档的开头,从doctype和opening
标记到(至少)
标记。这是错过了所有这些;您是否试图在其他地方(以非标准方式)创建它?
<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/your_extra_path/wp-load.php' ); ?>