【发布时间】:2016-11-11 12:55:09
【问题描述】:
我在 wordpress 中有一个名为“batches.php”的自定义模板页面,其中包含以下代码
echo '<a href="'.get_template_directory_uri().'/view-batches.php?bid=58233b48dbc43" >View</a>';
上面的代码将 bid=58233b48dbc43 发送到“view-batches.php”。
查看-batches.php:
<?php
/* Template name:View Batches */
echo "Batch id=".$_GET["bid"];
get_header();
get_footer();
?>
此代码打印出价,即 58233b48dbc43,但也显示 致命错误:调用未定义函数 get_header()
此问题的任何解决方案以及如何在 wordpress 中将数据从一页传递到另一页
【问题讨论】:
-
包含 wodpress 文件以使用其功能 require_once("wp-load.php");
-
这不起作用,错误 - 警告:require_once(wp-load.php) [function.require-once]:无法打开流:没有这样的文件或目录....@VishnuBhadoriya