是否可以将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
?>
来源:
https://www.srcmini02.com/65512.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_40906.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57