# Raptive广告的问题

**URL:** https://meta.discourse.org/t/issues-with-raptive-ads/276128
**Category:** WordPress
**Created:** [2023年八月22日 03:38 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128 "2023-08-22T03:38:55Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月22日 03:38 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/1 "2023-08-22T03:38:56Z")

</div>

我遇到了一个棘手的问题，似乎无法解决。据我所知，帖子 ID 并不总是能从 WordPress 网站 ([pistolsfiringblog.com](http://pistolsfiringblog.com)) 同步到我们的 Discourse 网站 ([forum.pistolsfiringblog.com](http://forum.pistolsfiringblog.com))，这导致 WordPress 帖子上的评论加载失败，并且无法评论（我们不允许 WP 评论，只允许 Discourse）。

以下帖子是一个很好的例子：  
**WP:** [Coleman Scott Joins Oklahoma State Wrestling Staff as Associate Head Coach](https://pistolsfiringblog.com/coleman-scott-joins-oklahoma-state-wrestling-staff-as-associate-head-coach/)  
**Discourse:** [Coleman Scott Joins Oklahoma State Wrestling Staff as Associate Head Coach - #4 by MiggityMac - PFB Articles - The Chamber](https://forum.pistolsfiringblog.com/t/coleman-scott-joins-oklahoma-state-wrestling-staff-as-associate-head-coach/18760/4)

即使帖子允许评论，post\_id 仍然显示为未定义。我稍微研究了一下 Discourse WordPress 插件，它在 id 未定义时会返回。这没问题，也是意料之中的。没有发现什么异常。然而，网站上的其他帖子显示评论，而有些则不显示。设置与不显示的帖子完全相同（我仔细比较过）。

如果我尝试强制将 id 放入 webhook 调用 [https://pistolsfiringblog.com/wp-json/wp-discourse/v1/discourse-comments?post\_id=259952，我会得到：](https://pistolsfiringblog.com/wp-json/wp-discourse/v1/discourse-comments?post_id=259952%EF%BC%8C%E6%88%91%E4%BC%9A%E5%BE%97%E5%88%B0%EF%BC%9A)  
`“\t\t<div class=\"respond comment-respond\">\n\t\t\t<div class=\"comment-reply-title discourse-no-connection-notice\">\n\t\t\t\t<p>Comments are not currently available for this post.</p>\n\t\t\t</div>\n\t\t</div>\n\t\t”`

……这完全不属实。评论是可用的，也是允许的。出于我无法理解的原因，我无法看到某些帖子没有获取 post\_id 来链接/关联到相应的 Discourse 帖子，以便评论能够流转到 WP。

更复杂的是，我以我们编辑的身份进行了一个测试帖子，并观察了从 WP 帖子到 Discourse 再回到 WP 的整个过程，包括 Discourse 的额外评论。在我的测试帖子中，它们都同步回了 WP。

我附上了主要问题的截图（不限于一个帖子）。非常感谢任何帮助。此时，我已完全不知所措。¯\_(ツ)_/¯

 ![Screenshot 2023-08-21 at 21.52.16](https://global.discourse-cdn.com/meta/original/4X/9/4/7/947829c12d1b51a74901f63e8262c66383f25a91.jpeg)  
 ![Screenshot 2023-08-21 at 21.50.00](https://global.discourse-cdn.com/meta/original/4X/b/1/0/b108afce0d38670b364fbd2f50e4edd8060ba8e5.jpeg)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年八月22日 04:36 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/2 "2023-08-22T04:36:06Z")

</div>

您好 @MiggityMac，我正在查看您的网站，注意到很多与谷歌广告相关的控制台错误。在 WordPress 页面上也遇到了浏览器崩溃的问题。此外，即使评论按钮可用并且可以进入评论区，在嵌入式评论的论坛部分也看到了内容策略和权限错误。目前还不确定，但广告相关的错误可能会导致与插件冲突的问题。我建议您检查一下内容安全策略设置，因为这可能会导致嵌入问题。我在我们的论坛上运行 WordPress 插件，有几次出现嵌入或按钮出现在 WordPress 页面上的问题，都是由内容安全策略设置引起的。在评论按钮可以正常工作的页面上，我仍然在 WordPress 和 Discourse 两边都看到了错误。我会继续查看并深入研究……

这是在 Discourse 上，其中一个可以正常工作的页面：

 ![wp-discourse_errors](https://global.discourse-cdn.com/meta/original/4X/5/8/1/5819a9bbe8cf5c07f2e714f0dfe754d8c3d20573.jpeg)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年八月22日 04:56 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/3 "2023-08-22T04:56:12Z")

</div>

@MiggityMac 你看过 WordPress 日志吗？

> [@View logs for the WP Discourse plugin](https://meta.discourse.org/t/view-logs-for-the-wp-discourse-plugin/190745):
>
> The WP Discourse plugin has its own logging system (since v2.2.5). This is an overview of how it works and how to use it. If you have any questions please respond below. What is logged All of the main WP Discourse feature-sets log errors (since v2.3.5). To log every action, including successful ones, you can turn on verbose logging for the relevant feature-set you want more information on. Look for a setting starting with “Verbose…” in the relevant settings tab. How logs are stored The plugin …

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年八月22日 06:58 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/4 "2023-08-22T06:58:44Z")

</div>

> [@Lilly](#):
>
> 你查看过 WordPress 日志吗？

@MiggityMac 我会从这里开始。Lily 提出的 CSP 建议也不错。另外，如果可能的话，你能分享一下该示例帖子在 WP 数据库中保存的 wp 元字段吗？

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月23日 16:16 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/5 "2023-08-23T16:16:38Z")

</div>

非常感谢您，@Lilly - 我昨天没能深入研究，但今天/明天我会的。这非常有帮助。我很快就会查看日志，看看那里发生了什么。

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2023年八月23日 16:28 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/6 "2023-08-23T16:28:10Z")

</div>

> [@Lilly](#):
>
> I’d review the content security policy settings because that can cause embedding issues.

Wordpress 插件是否在某个时候开始嵌入了？据我所知，它是在同步评论副本并在本地显示它们。

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月23日 16:41 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/7 "2023-08-23T16:41:44Z")

</div>

这是最近的 [WP Discourse](https://github.com/discourse/wp-discourse) 日志：  
[pistols-firing-wp-discourse-logs-2022-06-01-2023-08-23.zip](https://meta.discourse.org/uploads/short-url/oxcJ1YQgPPDvtJWd4XQkXfSRD14.zip) (159.7 KB)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年八月23日 22:03 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/8 "2023-08-23T22:03:41Z")

</div>

抱歉 @Stephen，你说得对，我只是把一些术语弄混了。我知道这个插件是如何工作的。

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2023年八月24日 02:45 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/9 "2023-08-24T02:45:53Z")

</div>

> [@MiggityMac](#):
>
> 从我看到的情况来看，帖子 ID 并不总是能从 WordPress 网站同步到我们的 Discourse 网站（[forum.pistolsfiringblog.com](http://forum.pistolsfiringblog.com)）。

我对正在发生的事情感到好奇，所以想看看。

您的日志中有很多 `429`（请求过多）错误。这些错误是在 WordPress 尝试从 Discourse 拉取帖子评论时发生的。我没有找到与您链接的帖子相关的错误，但错误日志可能被淹没，导致一些错误被跳过。

以下是我发现有错误的 Discourse 主题和 WordPress 帖子：

- [Three Questions for Oklahoma State's Offense Entering Fall Camp - PFB Articles - The Chamber](https://forum.pistolsfiringblog.com/t/three-questions-for-oklahoma-states-offense-entering-fall-camp/18545)
- [Three Questions for Oklahoma State’s Offense Entering Fall Camp](https://pistolsfiringblog.com/three-questions-for-oklahoma-states-offense-entering-fall-camp/)

开始调试问题的最简单方法是转到 WordPress 上的该帖子的编辑页面，然后启用“自定义字段”面板：

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/d/c/8dc11644b8a0fa2e23b5fae2ae8e1e5cc1f6c929.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/7/0/370b361f4584402022dbc7333ca5a1fcf52c4c62.png)

这应该会显示一些看起来像这样的字段：

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/e/9/6e954d314ac18eff373f9dc464c3812fd0fc6173.png)

我怀疑还会有一个名为 ‘wpdc\_sync\_post\_comments’ 的字段，其值设置为 1。如果出于某种原因它卡在 `1`，那将解释所有“请求过多”的错误。

另外，在 WordPress 插件的“评论”设置选项卡中，“启用 Discourse 评论”设置的值是多少？

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/8/d/98db84e9d049f0611ef7e7d02be7615bbfcd01bc.png)

让 Discourse 评论显示在您的 WordPress 网站上以前奏效过吗？如果奏效过，您能想到在评论停止显示时 WordPress 网站上可能发生了什么更改吗？

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月24日 12:20 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/10 "2023-08-24T12:20:46Z")

</div>

感谢您提供的信息。  
Discourse Comments 以前运行正常，直到我们遇到了 Raptive（ad thrive 更新）问题。  
Discourse 评论设置与您截图的设置相同。

我在帖子中启用了自定义字段。我在其他帖子中看不到任何字段，但在我引用的帖子中可以看到。`wpdc_sync_post_comments` 设置为零。

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/c/6/ac6933dfdc00fec097ce124f303bc8cfc028d837.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/4/e/3/4e3d5318feb7d00e175e6c9d42e5dfbfa966eced.png)

我今天早上会获取一个“损坏”帖子的元数据。

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月24日 19:58 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/11 "2023-08-24T19:58:54Z")

</div>

@simon - 这是损坏帖子的帖子元数据（在此处找到：[https://pistolsfiringblog.com/arizona-state-reportedly-names-true-freshman-jaden-rashada-as-starting-quarterback/）](https://pistolsfiringblog.com/arizona-state-reportedly-names-true-freshman-jaden-rashada-as-starting-quarterback/%EF%BC%89)

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/d/d/7ddf3d3d172f491d354ff791c1e1621e8075ce19.png)

以及帖子数据（分段截图）：

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/b/b/fbbc506b415e747f73a6e277013ab6c8dbdcba1d.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/3/f/6/3f615d180521aabfddadee19d5549dcbebbcb663.png)

并且 DC 日志中出现了一些错误（但这是因为我之前更新过）：

````plaintext
[2023-08-24 19:50:18] publish.ERROR: create_post.post_error {"wp_title":"Arizona State Reportedly Names True Freshman Jaden Rashada as Starting Quarterback","wp_author_id":"20980","wp_post_id":260073,"response_message":"Embed url has already been taken","http_code":422}```

这有帮助吗？
````

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2023年八月24日 20:30 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/12 "2023-08-24T20:30:24Z")

</div>

我稍后会仔细查看所有这些。希望是今天。

> [@MiggityMac](#):
>
> 这是损坏帖子的帖子元信息

```plaintext
[2023-08-24 19:50:18] publish.ERROR: create_post.post_error {"wp_title":"Arizona State Reportedly Names True Freshman Jaden Rashada as Starting Quarterback","wp_author_id":"20980","wp_post_id":260073,"response_message":"Embed url has already been taken","http_code":422}

```

“Embed url has already been taken”错误应该由 [WP Discourse](https://github.com/discourse/wp-discourse) 插件处理。当您的 Discourse 站点上已存在与 WordPress 帖子 URL 关联的主题时，就会出现此错误。触发此错误的最简单方法是将帖子发布到 Discourse，然后单击 WordPress 上的“取消链接到 Discourse”按钮，然后尝试将帖子重新发布到 Discourse。结果应如下所示：

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/0/d/90df7b171c523ab2fd24c8c0b50d784fb7f07f4a.png)

UI 试图表明的是，您需要将相关 Discourse 主题的 URL 输入到“主题 URL”输入框中，而不是将帖子发布到 Discourse。不过，显示的错误消息可以改进。

我不确定这是否能解决您 WordPress 站点上 Discourse 评论的所有问题。例如，这是您为自定义字段提供详细信息的帖子和主题：

- [https://forum.pistolspirinfblog.com/t/three-questions-for-oklahoma-states-offense-entering-fall-camp/18545](https://forum.pistolspirinfblog.com/t/three-questions-for-oklahoma-states-offense-entering-fall-camp/18545)
- [Three Questions for Oklahoma State’s Offense Entering Fall Camp](https://pistolsfiringblog.com/three-questions-for-oklahoma-states-offense-entering-fall-camp/)

这些自定义字段包含了我期望看到的、如果评论成功显示的话的数据，但我甚至在 WordPress 页面上看不到 Discourse 评论模板。我猜是您的主题中的某些内容阻止了它加载。

您能否确认此处选择了“显示所有主题的评论”选项，而不是“显示评论链接”选项？我只是问一下，以防这与缺失的评论模板有关。

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/e/2/ae2ef207617c5e9964f11088212eaaab0f51d15a.png)

另外，看起来您启用了“通过 Ajax 加载评论”选项。我在帖子的源代码中看到了对该脚本的调用。在问题解决之前，请尝试禁用该选项，然后重新启用它，看看是否会导致问题。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年八月25日 04:58 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/13 "2023-08-25T04:58:37Z")

</div>

> [@MiggityMac](#):
>
> Discourse Comments used to work fine until we had a problem with Raptive (ad thrive updates).

嘿 Michael，你能解释一下你遇到的 Raptive 问题吗？你的网站上是否仍然启用了它？

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月25日 17:33 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/14 "2023-08-25T17:33:14Z")

</div>

@angus - 我真希望能解释得更清楚些，但几周前的某一天广告突然停止工作了——很可能是某个插件自动更新导致的。我希望能有更深入的诊断手段，但日志里并没有相关信息。我们曾与 Raptive 合作让他们重新上线，目前看来他们运行正常。Raptive 方面发现的最关键问题是，我需要基本关闭我们论坛和博客的 CORS 设置。在那之后，广告就开始正常工作了。

我们的博客（WordPress）使用 Cloudflare 作为 CDN 提供商。它运行在 OpenLiteSpeed 服务器上，但没有使用 OLS 的 CDN（而是使用 Cloudflare）。任何更新、帖子发布或插件更新时，缓存都会立即失效。

我用于 Raptive 广告的代码如下：

```function
    if ( function_exists('is_subscribed_to_memberful_plan') && is_subscribed_to_memberful_plan( array('98342-fallcamp2023', '21436-gray-monthly', '21300-white-monthly', '34796-pfb-yearly', '34795-pfb-monthly', '69495-pfb-2021') ) ) {
        ?>
        <script>
            adthrive.cmd.push(function() {
                adthrive.disableAds();
            });
            jQuery('body').addClass('logged-in-no-ads');
        </script>
        <?php
    }
}
add_action('wp_footer', 'enqueue_custom_footer_script');

```

我知道这可能有点多，但这里是我们子主题中使用的一些旧 CSS，用于进行样式调整。我正在着手清理这些代码：

```plaintext
/*div#mvp-main-nav-top {
    display: none;
}
*/
/*.mvp-nav-bot-right-out {
    width: 100% !important;
}*/

.mvp-nav-bot-right.left.relative {
  float: none !important;
}
.mvp-nav-bot-right-in {
    margin-right: 88px;
}
#mvp-main-nav-bot-cont {
  background: #1a1a1a !important;
}
li#menu-item-207620 {
    top: -4px;
}
/*.menu-image-title-hide {
    margin-top: -19px !important;
    margin-bottom: -12px !important;
}*/
ul#menu-new-global-menu li:first-child a :not(.sub-menu) {
    margin-bottom: -16px !important;
    margin-top: 0px !important;
}
/ ***防止 Elite Media 干扰页面顶部边距**** /
.adthrive-footer-message {
    margin-bottom: 0px !important;
    padding-bottom: 16px;
    background: black;
}
.adthrive-comscore.adthrive-footer-message {
  margin-top: 0px !important;
}
/*头像*/
.account-link img {
    width: 35px !important;
    height: 35px !important;
    border: 2px solid #ddd !important;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    border-radius: 50%;
}
.account-link a {
  padding: 0px 0px 5px 0px !important;
  top: 6px !important;
  height: 39px !important;
}
.account-link {
  margin-left: 16px !important;
  top: -11px;
}
.account-link:hover {
    top: -6px;
}
/*li#menu-item-208021:hover {
    top: -5px;
}*/

.mvp-nav-the-chamber-link {
  content: url("https://pistolsfiringblog.com/wp-content/uploads/2020/01/Chamber-e1580357588365.png");
  cursor: pointer;
  max-width: 38px;
  max-height: 38px;
  float: right;
  margin-top: 7px;
  margin-right: 8px
}

.mvp-nav-menu ul:first-child {
    display: inline-block;
    position: relative;
    padding-left: 8px !important;
    float: left !important;
}

.mvp-nav-menu ul li a {
    font-size: large;
}
.sub-menu li {
  margin-left: 0px !important;
  padding-left: 0px !important;

}
.nav-menu-logo-link {
  pointer-events: none;
  cursor: pointer;
  padding: 0;
  margin-top: 0px !important;
  padding-right: 16px;
}

.nav-menu-logo-link a {
  padding-top: 15px !important;
}

a.menu-image-title-hide.menu-image-not-hovered.external {
    padding: 0;
    /* float: left; */
}
.menu-item a img, img.menu-image-title-after, img.menu-image-title-before, img.menu-image-title-above, img.menu-image-title-below, .menu-image-hover-wrapper .menu-image-title-above {
    border: none;
    box-shadow: none;
    vertical-align: super;
    width: 175px;
    display: inline;
}

.mvp-nav-bot-right {
  width: 50px;
  height: 50px;
  display: inline-flex;
  /*right: 79px;*/
}
.mvp-nav-search-but {
  float: left;
}
span.mvp-nav-search-but {
  cursor: pointer;
  float: left;
  font-size: 20px;
  line-height: 1;
  padding: 15px 15px;

}

.mvp-nav-menu ul li a, #mvp-nav-bot-wrap span.mvp-nav-search-but {
    color: white !important;
}

#mvp-nav-bot-wrap .mvp-fly-but-wrap span, #mvp-nav-bot-wrap .mvp-search-but-wrap span {
    background: white;
    font-size: initial;
}

.textwidget {
   margin-bottom: 5px;
   background: #ff6600;
   padding: 10px;
   font-size: 19px;
   margin-top: 25px;
}

#mvp-post-content {
    width: 100%;
    max-width: 1200px;
}

.textwidget a, a:visited {
   text-decoration: underline;
}

.mvp-flex-story-text p {
    color: #555;
    float: left;
    font-size: 20px;
    font-weight: 300;
    line-height: 1.4;
    margin-top: 10px;
    width: 100%;
}

#mvp-home-widget-wrap .mvp-flex-row .mvp-flex-story-text h2 {

    color: #333333;
    float: left;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    width: 100%;

}

.mvp-main-box {
    margin: 0 auto;
    width: 1200px;
    height: 100%;
}

.mvp-widget-ad img {
  width: 100%;
  max-width: 1200px;
}

#mvp-post-content {
    width: 100%;
    max-width: 1200px;
}

p a.external, #mvp-content-main p a, .mvp-post-add-main p a {
  color: #ff6600 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

#mvp-content-main a:visited {
  color: #ff6600 !important;
}

h1.mvp-post-title {
  font-size: 30px !important;
}

#mvp-content-main ul {
  font-family: 'PT Serif', sans-serif !important;
}

#mvp-content-main p a:hover, .mvp-post-add-main p a:hover {
  text-decoration: underline !important;
  background: none !important;
}

.mvp-feat5-mid-main-text h2 {
  color:#222222;
  float:left;
  font-size:1.4rem;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.2;
  width:100%;
}

.mvp-feat5-small-main-text h2 {
  color:#222222;
  float:left;
  font-size:1.3rem;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.2;
  width:100%;
}

.mvp-feat5-mid-sub-text h2 {
  color:#222222;
  float:left;
  font-size:1.2rem;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.2;
  width:100%;
}

.mvp-blog-story-text h2 {
  color:#222222;
  float:left;
  font-size:1.4rem;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.1;
  width:100%;
}

#mvp-home-widget-wrap .mvp-flex-col .mvp-flex-story-text h2 {
  font-size:1.4rem;
}

span.mvp-feat1-pop-head {
  font-family: 'Oswald', sans-serif;
  }

/* 从旧的 Pistols Firing 网站复制 */

blockquote {
/* border-left-color: #232323 !important;
  border-left-style: solid !important;
  border-left-width: 6px !important;*/
  font-family: inherit !important;
  font-style: italic !important;
  font-weight: 400 !important;
  margin: 0 0 0 15px !important;
  padding-left: 3px !important;
  line-height: 30px !important;
  color: #232323 !important;
  position: relative !important;
}

blockquote, q {
    quotes: "" "" !important;
}

/* 自定义尺寸位于媒体查询中 */
#mvp-content-main blockquote p, .mvp-post-add-main blockquote p {
  font-style: normal !important;
  font-family: 'PT Serif', sans-serif !important;
  font-weight: 400 !important;
  letter-spacing: -.02em !important;
  line-height: 30px !important;
  margin: 30px 3% !important;
  width: 80% !important;
  word-wrap: break-word !important;
}

#mvp-content-main ul li, #mvp-content-main ol li, .mvp-post-add-main ul li, .mvp-post-add-main ol li {
    font-family: 'PT Serif', sans-serif !important;
    font-weight: 400;
    line-height: 30px;
    margin-bottom: 5px;
    margin-left: 30px !important;
}

/* 移除单篇文章底部的“相关文章” */
.mvp-post-tags {
  display: none !important;
}

.mvp-widget-feat1-top-story span.mvp-cd-cat {
  color: white !important;
}

#mvp-content-main p {
   max-width: 100% !important;
}

/* 表格标题背景 */
#mvp-content-main tbody tr:first-child, .mvp-post-add-main tbody tr:first-child {
  background: #ff6600;
  text-align: left;
  color:white;
}

#mvp-content-main table, .mvp-post-add-main table {
    margin-bottom: 25px;
    color: #333333;
}

/* 广告特定样式 */
.widget_recent_comments ul li:last-child, .widget_recent_entries ul li:last-child {
    margin-bottom: 30px;
}

/* 菜单样式 */
nav.mvp-fly-nav-menu ul li.menu-item-has-children:before{
  color:white !important;
}

/* 菜单样式 */
nav.mvp-fly-nav-menu ul li.menu-item-has-children:after{
  color:white !important;
}

#mvp-content-main {
  margin-bottom: 5px !important;
}

nav.mvp-fly-nav-menu ul li:first-child {
    display: none;
}

#mvp-content-main blockquote p, .mvp-post-add-main blockquote p {
    background: #ffeadc !important;
    padding: 14px;
    border-radius: 5px;
}

@media screen and (max-width: 999px) {
  

}

@media only screen and (min-width: 1000px) and (max-width: 1023px) {
    .mvp-nav-menu ul li {
    display: inline-block;
    position: relative;
    padding-left: 3px !important;
    float: left !important;
  }
  .mvp-nav-the-chamber-link {
    margin-top: 9px !important;
  }
}
/* 屏幕大于 1024px */
@media only screen and (min-width: 1000px) {
  /* 在桌面端隐藏顶部社交栏 */
  div#mvp-main-nav-top{
    display: none !important;
  }
  .mvp-nav-menu ul {
    width: auto;
  }

  /* 用于在向上滚动时保持自定义导航栏固定且美观 */
  .mvp-fixed2 {
    -webkit-transform: translate3d(0,70px,0) !important;
    -moz-transform: translate3d(0,70px,0) !important;
    -ms-transform: translate3d(0,70px,0) !important;
     -o-transform: translate3d(0,70px,0) !important;
    transform: translate3d(0,70px,0) !important;
  }
  .chamber-link-small-screen {
    display: none;
  }

  #mvp-content-main p, .mvp-post-add-main p {
    font-size: 20px !important;
  color: #333333 !important
  }

  #mvp-content-main blockquote p, .mvp-post-add-main blockquote p {
    font-size: 20px !important;
    color: #333333 !important;
  }

  #mvp-content-main ul li, #mvp-content-main ol li, .mvp-post-add-main ul li, .mvp-post-add-main ol li {
    font-size: 20px !important;
    color: #333333 !important
  }
}

/* 屏幕小于 1024px */
@media only screen and (max-width: 999px) {
  .mvp-nav-top-right {
    width: 64px !important;
    margin-right: -13px;
  }
  .mvp-nav-top-right .mvp-nav-search-but {
    display: none;
    padding: 6px 0 7px;
  }
  .mvp-nav-the-chamber-link {
    content: url("https://pistolsfiringblog.com/wp-content/uploads/2020/01/Chamber-e1580357588365.png");
    cursor: pointer;
    max-width: 30px;
    max-height: 30px;
    float: right;
    margin-top: 0px;
  }
  #mvp-content-main p, .mvp-post-add-main p {
    font-size: 17px !important;
    color: #333333 !important
  }

  #mvp-content-main blockquote p, .mvp-post-add-main blockquote p {
    font-size: 17px !important;
    color: #333333 !important
  }

  #mvp-content-main ul li, #mvp-content-main ol li, .mvp-post-add-main ul li, .mvp-post-add-main ol li {
    font-size: 20px !important;
    line-height: 30px;
    color: #333333 !important;
  }
  .mvp-blog-story-text h2, #mvp-home-widget-wrap .mvp-flex-row .mvp-flex-story-text h2, #mvp-home-widget-wrap .mvp-flex-col .mvp-flex-story-text h2 {
    font-size: 1.15rem !important;
    line-height: 1.1em !important;
  }
  span.mvp-cd-cat, span.mvp-cd-date {
    font-size: 0.8rem !important;
  }
  
  div#comments .comment-content p {
    font-size: 17px !important;
  }

}
.mvp-feat1-feat-text span.mvp-cd-cat{
  color: #ffffff !important;
}
@media screen and (max-width: 479px) {
  .mvp-blog-story-text h2, #mvp-home-widget-wrap .mvp-flex-row .mvp-flex-story-text h2, #mvp-home-widget-wrap .mvp-flex-col .mvp-flex-story-text h2 {
    font-size: 1.15rem !important;
    line-height: 1.1em !important;
  }
  span.mvp-cd-cat, span.mvp-cd-date {
    font-size: 0.8rem !important;
  }
  div#comments .comment-content p {
    font-size: 17px !important;
  }
}

@media only screen 
and (min-device-width : 375px) 
and (max-device-width : 667px) { 
  #mvp-content-main p {
    font-size: 17px !important;
  }
  div#comments .comment-content p {
    font-size: 17px !important;
  }
}

.custom-call-to-action {
    background: #f6d8cb;
    border-radius: 5px;
    padding: 16px;
    border: 3px solid #f60;
    margin-bottom: 8px;
}

.custom-call-to-action p {
  color: #333 !important;
}

.custom-call-to-action a:hover {
  color: gray !important;
}

/* Discourse 评论部分 */
.discourse-comments-area ~ .comments-area .comments-title {
	display: none;
}
#comments {
    clear: both;
}

#comments > ol {
    border-top: 1px solid #E0E0E0;
    padding: 15px 0px;
}

#comments .comment {
    display: block;
    padding: 10px 0px 30px;
    background-color: #FFF;
    transition: background-color 1000ms;
}

#comments .comment p {
    word-wrap: break-word;
}

#comments .fn {
    font-size:16px !important;
}

.comment-metadata {
    font-size:16px !important;
    margin-top: 5px;
}

article #comments .respond > h3 {
    margin-bottom: 5px;
}

#comments-title {
    padding-bottom: 20px;
}

h2.discourse-comments-title {
    display: none;
}

.comment-content {
    clear: left;
    padding-top: 1px;
}

.comment-content ol, .comment-content ul {
    overflow: auto;
}

.comment-content p {
    margin-bottom: 10px;
    font-size: 20px!important;
    color: #333!important;
    line-height: 1.5;
    font-family: 'PT Serif', sans-serif;
}

.comment-content > blockquote {
	font-style: normal !important;
    margin-left: 30px;
    border-left: 5px solid #eaf9ff;
    padding-left: 10px;
}

.comment-content .quote, .comment-content .onebox {
    margin-left: 30px;
    margin-top: 15px;
    margin-bottom: 10px;
    border-left: 5px solid #eaf9ff;
    padding-left: 10px;
}

.comment-meta {
    color: #808080;
}

.avatar-64 {
    margin-bottom: 10px;
}

span.says {
    display: none;
}
 */
/* 开始旧版 WordPress 评论 */

li.comment {
    list-style: none;
    padding: 0px 0px 25px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

section.comments {
    margin-bottom: 10px;
    margin-top: 25px;
}

section.comments {
    margin-bottom: 10px;
}

section.comments ol h2 {
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.archive .comments.wp h2 {
    display: none;
}

.archive .comments.wp {
    border: 0;
    width: 200px;
    float: left;
    padding-left: 20px;
}

.comment-content li {
    margin-left: 40px;
}

#comments .avatar {
    width: 64px;
    height: 64px;
    float: left;
    margin-right: 10px;
    border-radius: 50%;
}

#comments .avatar-25 {
    width: 32px;
    height: 32px;
    margin-right: 5px;
    border-radius: 50%;    
}

#comments h3#reply-title {
    display:block !important;
  text-align: center !important;
    color:#333 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    margin-bottom: 10px !important;
    text-transform: uppercase !important;
    padding: 5px 10px !important;
    text-shadow:none;
}
#comments h3#reply-title a {
    color:#ff6600 !important;
    text-decoration:underline !important;
} */
/* 隐藏小头像 */
.comment-reply-title, .more-replies {
    display: none;
}

```

我还需要补充一点，这个网站拥有超过 2.7 万篇文章，已有近 10 年的历史，积累了大量数据。本周末，我计划更新主题、清理 CSS，并确保我们没有无意中引发任何冲突。

大家能帮忙调查这个问题真是太棒了。我真的很感激。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年八月25日 22:42 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/15 "2023-08-25T22:42:22Z")

</div>

迈克尔，我这样理解对吗？

1. 你遇到了Raptive的问题。
2. 你在网站上应用了上面详述的更改来解决该问题。
3. 应用这些更改后，WP Discourse插件停止工作了。

我理解得对吗？

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月26日 02:53 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/16 "2023-08-26T02:53:31Z")

</div>

@angus - 我希望听起来不像是在指责 Raptive——他们的服务一直很棒，他们的客户支持也很出色。我几乎会向任何人推荐他们。但据我所知，这一切似乎都碰巧发生了。除非我遗漏了什么完全意想不到的事情。¯\_(ツ)_/¯

我确实联系了 Raptive，他们非常乐于助人，并支持我尝试理解正在发生的事情，包括追查日志中不断出现的弃用错误。

但为了确定，我重新启用了他们的插件，确保我们的广告代码正常工作，而 [WP Discourse](https://github.com/discourse/wp-discourse) 仍然无法正常使用。截至今天，Raptive 插件的开启或关闭似乎都没有影响它。我正在尝试重现可能发生的情况，看看是否能注意到其他任何问题。明天，我将对网站代码进行一次彻底的深入检查和重置。我会尽可能有条理，这样如果这是一个错误或配置错误，将来我们就能帮助其他可能遇到此问题的人。

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [2023年八月26日 07:58 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/17 "2023-08-26T07:58:13Z")

</div>

您已经提到，您为修复 Raptive 问题所做的更改很可能是导致此问题的原因。

您是否已与 [WP Discourse](https://github.com/discourse/wp-discourse) 插件讨论过，在您根据他们的建议进行更改后，您遇到的问题？

请注意，如果您在 CDN、CORS 配置和主题中进行了更改，关闭和重新打开 Raptive 插件不会改变这些因素的影响。

我也不想过分指责 Raptive，但仅根据您所说的，这些方面似乎需要进一步调查？

无论如何，请告知我们网站重建的进展。

---

<div class="post-metadata">

### Author: ![MiggityMac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/miggitymac/32/156658_2.png) [@MiggityMac](https://meta.discourse.org/u/MiggityMac)
#### Post date: [2023年八月26日 17:50 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/18 "2023-08-26T17:50:43Z")

</div>

@angus - 我已完成网站刷新、主题更新、插件调整等工作。我发现了问题，而且很难找到。我们正在使用的主题（一个经过大量修改的 Zox News 主题）的父主题进行了一次更新，不知何故与其它插件一起被更新了。

子主题处理得不太好。Zox News 主题有一个用于 Disqus 集成的地方，并且完全覆盖了标准的 WP Comment HTML 结构。我不得不编辑父主题，以阻止它显示一个评论按钮，并基本上劫持了正在寻找（已不存在的）WP Comments 结构的 [WP Discourse](https://github.com/discourse/wp-discourse) 代码注入。

网站后端仍然有些混乱，但我会在周末进行清理。

这是导致问题的代码片段：

```plaintext
    <!-- DELETE THIS from post-single.php in parent theme -->
	<!-- <div id="mvp-comments-button" class="left relative mvp-com-click">
	    <span class="mvp-comment-but-text"><?php comments_number(__( 'Click to comment', 'zox-news'), esc_html__('1 Comment', 'zox-news'), esc_html__('% Comments', 'zox-news'));?></span>
	</div>-->
    <!--mvp-comments-button-->

```

我已测试了大约 5 篇不同的帖子，开启或关闭了评论。到目前为止，情况还好。如果周末/本周情况顺利，我会标记一个解决方案。

再次感谢大家！！！

---

<div class="post-metadata">

### Author: ![falcon9](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falcon9/32/311948_2.png) [@falcon9](https://meta.discourse.org/u/falcon9)
#### Post date: [2023年十月8日 18:10 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/19 "2023-10-08T18:10:08Z")

</div>

> [@MiggityMac](#):
>
> Raptive最大的发现是，我基本上需要关闭我们论坛和博客上的CORs。

我正在尝试弄清楚这一切。我有两个网站使用Raptive……但我的Discourse网站没有。

你是怎么做到的？你是否在app.yml中使用了DISCOURSE\_ENABLE\_CORS？

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2023年十月9日 00:03 UTC](https://meta.discourse.org/t/issues-with-raptive-ads/276128/20 "2023-10-09T00:03:05Z")

</div>

关于 Discourse 评论未在网站上显示的问题，我认为 CORS 没有产生任何影响。问题的原因是网站上正在使用的主题阻止了 Discourse 评论模板的加载。

您正在尝试解决什么问题？它与 [WP Discourse](https://github.com/discourse/wp-discourse) 插件有关，还是仅仅是您的 WordPress 网站上的 Raptive 广告出现的问题？

[下一頁](https://meta.discourse.org/t/issues-with-raptive-ads/276128.md?page=2)
