【问题标题】:action in wordpress to template pagewordpress 到模板页面的操作
【发布时间】:2017-08-07 23:29:00
【问题描述】:

在我的插件中,我的表单中有一个操作应该将我带到一个名为 go 的模板页面,但是当我点击它时,wordpress 告诉我它不存在但如果我刷新页面然后它会加载去页面。任何想法为什么它不能正常加载以及如何修复它?

<form name="trailer-bulk-waste-free" method="post" action="go">
<input type="hidden" name="date" value="<?php echo"$date"; ?>">
<input type="hidden" name="pickup" value="<?php echo"$pu" ?>">
There is a bunch of other inputs in here but probably redundant to put. 
<p><input type="submit" name="CONTINUE" value="CONTINUE" />

【问题讨论】:

  • 您介意添加一些代码来帮助我们了解您正在处理的内容吗?
  • 我也试过有 action="go.php" 但没有用,而且它需要一个插件才能有一个以 .php 结尾的模板

标签: wordpress templates action


【解决方案1】:

一个简单直接的方法是assign the go page template to a page。假设该页面的ID77,然后执行此操作。

<form name="trailer-bulk-waste-free" method="post" action="<?php the_permalink( 77 ); ?>">
    <input type="hidden" name="date" value="<?php echo"$date"; ?>">
    <input type="hidden" name="pickup" value="<?php echo"$pu" ?>">
    There is a bunch of other inputs in here but probably redundant to put. 
    <p><input type="submit" name="CONTINUE" value="CONTINUE" /></p>
</form>

希望这会如您所愿。

【讨论】:

  • 好的,亲爱的,我试试看,我在哪里可以得到或如何设置页面 ID?
  • 这是您创建并分配了go 模板的页面ID。它会自动生成。 Check this for help
【解决方案2】:

用其他浏览器试试看是否来自浏览器的缓存。

【讨论】:

  • 用 chrome 或 E 试过了,但没有运气
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-15
  • 2012-10-08
  • 2016-05-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多