个性化阅读
专注于IT技术分析

包括自定义位置的页眉和页脚

是否可以将wordpress标头包含在位于文件夹中的php文件中, 例如:wp-content / uploads / custom.php?


#1


你可以利用此文档:将WordPress与你的网站集成

在你的情况下, 你可以创建文件content.php并添加以下代码, 我刚刚在我的网站上尝试了此方法, 它的工作原理是:

<?php 
  $path = $_SERVER['DOCUMENT_ROOT']; // Gets the root directory URL
  $path .= '/domain_dir'; // Appends your WordPress installation URL
  require( dirname($path) . '/wp-blog-header.php'); // Require this to execute get_header();

  get_header(); // Executes header.php
?>
赞(0)
未经允许不得转载:srcmini » 包括自定义位置的页眉和页脚

评论 抢沙发

评论前必须登录!