WordPress插件Contact Form 7提交表单后跳转到一个指定的页面

导语:Contact Form 7是一个非常棒的表单提交插件,如果它和SMTP插件结合起来,那么别人提交的表单信息可以直接发送到你的邮箱里面。如果想直接在后台看到提交的数据,可以和Contact Form DB插件结合使用。

提交Contact Form 7表单后跳转到指定的页面

Contact Form 7表单提交后,它会在当前的页面出现一句话:

Thank you for your message. It has been sent.

这句话,你可以自己修改为其他的内容,修改的地方在后台 > Contant > Contant Form > 你自己创建的表单 > Messages 里面。

如果你需要它跳转到其他的页面,那么需要在后台设置一下,例如跳转到donate页面。

那么需要登陆 后台 > Contant > Contant Form > 你自己创建的表单 > Additional Settings ,在下面的编辑框中输入下面的代码:

on_sent_ok: "location = 'https://www.wordpressleaf.com/donate';"

这样,提交表单后就会跳转到donate。

如果你想要跳转到其他的页面,那么把https://www.wordpressleaf.com/donate改为其他页面的网址就可以了。

结束

你学会了吗?


Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

Warning: copy(): Failed to enable crypto in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

Warning: copy(https://www.wordpressleaf.com/wp-content/themes/summerleaf/images/tx/96.png): failed to open stream: operation failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

目前在“WordPress插件Contact Form 7提交表单后跳转到一个指定的页面”上有3条评论


  1. Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

    Warning: copy(): Failed to enable crypto in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

    Warning: copy(https://www.wordpressleaf.com/wp-content/themes/summerleaf/images/tx/77.png): failed to open stream: operation failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546
    abc说道:

    这个方法已经被禁了


    1. Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

      Warning: copy(): Failed to enable crypto in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

      Warning: copy(https://www.wordpressleaf.com/wp-content/themes/summerleaf/images/tx/21.png): failed to open stream: operation failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546
      HJ说道:

      现在有什么方法可以跳转吗?


  2. Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

    Warning: copy(): Failed to enable crypto in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546

    Warning: copy(https://www.wordpressleaf.com/wp-content/themes/summerleaf/images/tx/76.png): failed to open stream: operation failed in /opt/lampp/htdocs/wordpresssummer/wp-content/themes/summerleaf/inc/summer_setting.php on line 546
    雷锋说道:

    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘http://example.com/’;
    }, false );

    2021年5月4日 亲测。
    在官网介绍中发现的,把上面的代码加入到模板中可以实现跳转。

发表评论

邮箱地址不会被公开。 必填项已用*标注