小编And*_*ewD的帖子

重力形式Ajax不起作用

使用Gravity Forms 1.8.1,没有激活其他插件.使用最新版本1.9.2测试使用Divi主题测试,以及具有相同结果的2015主题.在Chrome和Firefox中测试,结果相同.

添加了以下短代码:

[gravityform id="1" name="test-form-1" ajax="true"]
Run Code Online (Sandbox Code Playgroud)

表单提交,但始终使用非ajax并刷新页面.我可以通过查看选项卡并查看Chrome开发人员工具中的"Net"选项卡和Firefox中的Firebug来说明这一点.XHR请求是空的,请求清除并正常发布,如果它是非ajax请求.

这应该工作.在查看Firebug的控制台选项卡时,我没有遇到任何错误或冲突.我发现没有人遇到类似的问题,虽然不确定有多少重力形式的用户正在关注萤火虫的行为.

我确定我错过了一些明显的东西.让我知道它是什么!


Gravity Forms生成的相关表单代码

<div id="gform_wrapper_1" class="gf_browser_gecko gform_wrapper">
   <a class="gform_anchor" name="gf_1" id="gf_1"></a>
   <form action="/sandbox/#gf_1" id="gform_1" target="gform_ajax_frame_1" enctype="multipart/form-data" method="post">
      <div class="gform_heading">
         <h3 class="gform_title">test-form-1</h3>
         <span class="gform_description"></span>
      </div>
      <div class="gform_body">
         <ul class="gform_fields top_label description_below" id="gform_fields_1">
            <li class="gfield               gfield_contains_required" id="field_1_1">
               <label for="input_1_1" class="gfield_label">Name<span class="gfield_required">*</span></label>
               <div class="ginput_container"><input type="text" tabindex="1" class="medium" value="Joe Smith" id="input_1_1" name="input_1"></div>
            </li>
         </ul>
      </div>
      <div class="gform_footer top_label"> <input type="submit" onclick="if(window[&quot;gf_submitting_1&quot;]){return false;}  if( !jQuery(&quot;#gform_1&quot;)[0].checkValidity || jQuery(&quot;#gform_1&quot;)[0].checkValidity()){window[&quot;gf_submitting_1&quot;]=true;} " tabindex="2" value="Submit" class="button gform_button" id="gform_submit_button_1"><input type="hidden" value="form_id=1&amp;title=1&amp;description=1&amp;tabindex=1" …
Run Code Online (Sandbox Code Playgroud)

ajax wordpress gravity-forms-plugin

2
推荐指数
2
解决办法
1万
查看次数

使用include()在template_redirect上的WordPress页面的标题中找不到页面

我已经为我的Wordpress网站添加了一个自定义重写规则,如下所示:

add_rewrite_rule( 'register/bronze', 'index.php?action=register&type=2', 'top' );
Run Code Online (Sandbox Code Playgroud)

然后在template_redirect操作中,我检查actionquerystring变量并加载我的include,如下所示:

$action = get_query_var( 'action' );

if( $action == "register" ) {
    include( BG_FILE_PATH . '/templates/register-brand.php' );
    exit;
}
Run Code Online (Sandbox Code Playgroud)

这一切都正常,我的自定义模板显示,但页面标题显示为"找不到页面|站点名称".

有没有办法从我的自定义模板设置页面标题?我试图避免将这些页面设置为Wordpress页面,因为它们是网站运行的基础,我不希望其中一个管理员更改页面设置或完全删除页面.

任何帮助深表感谢.

php wordpress rewrite

0
推荐指数
1
解决办法
1321
查看次数

标签 统计

wordpress ×2

ajax ×1

gravity-forms-plugin ×1

php ×1

rewrite ×1