【问题标题】:Mailchimp embed code not working in wordpressMailchimp 嵌入代码在 wordpress 中不起作用
【发布时间】:2017-10-19 12:13:59
【问题描述】:

我试图在我的 wordpress 网站中嵌入一个注册表单。我所做的是这样的:我去了那个页面的 wordpress 编辑器并选择添加原始 html 代码的选项。然后粘贴以下代码:

<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/slim-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="https://luisaspagnolistanford.us3.list-manage.com/subscribe/post?u=3b43aec3c5c107948b570c43d&amp;id=b67bd69928" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
      <label for="mce-EMAIL">Get notified about events and sales</label>
      <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
      <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
      <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_3b43aec3c5c107948b570c43d_b67bd69928" tabindex="-1" value=""></div>
      <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
  </div>
</form>
</div>

<!--End mc_embed_signup-->

然后设计很好,我可以从 chrome 的检查元素选项中看到所有代码,但是当单击提交按钮时它没有做任何事情,也没有错误。我只是想知道这里有什么问题。

【问题讨论】:

    标签: wordpress mailchimp


    【解决方案1】:

    target="_blank" 这意味着表单响应会在新选项卡中打开。寻找标签。

    您的core-scripts.js 文件中有一个脚本阻止了默认行为。删除它。

    $( "#mc-embedded-subscribe-form" ).submit(function( e ){
        var $this = $(this);
    
        e.preventDefault();
    

    【讨论】:

    • 不幸的是那里没有弹出或新标签。请在这里查看link
    • 谢谢,我现在无法访问该文件,但我所要做的就是给我的表单一个新的 ID,它就可以工作了。
    猜你喜欢
    • 2018-10-16
    • 2021-09-17
    • 1970-01-01
    • 2015-09-06
    • 2018-12-27
    • 1970-01-01
    • 1970-01-01
    • 2020-07-25
    • 1970-01-01
    相关资源
    最近更新 更多