Title: Disqus Conditional JS Load
Author: jp2112
Published: <strong>2014 年 4 月 19 日</strong>
Last modified: 2014 年 8 月 16 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/disqus-conditional-js-load.svg)

# Disqus Conditional JS Load

 作者：[jp2112](https://profiles.wordpress.org/jp2112/)

[下载](https://downloads.wordpress.org/plugin/disqus-conditional-js-load.zip)

 * [详情](https://cn.wordpress.org/plugins/disqus-conditional-js-load/#description)
 * [评价](https://cn.wordpress.org/plugins/disqus-conditional-js-load/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/disqus-conditional-js-load/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/disqus-conditional-js-load/#developers)

 [支持](https://wordpress.org/support/plugin/disqus-conditional-js-load/)

## 描述

Disqus is a third-party comment management system. However it loads its javascript
code on every page indiscriminately. This code should only be loaded on pages where
the comments form is actually going to load. Otherwise your site is wasting cycles
including javascript that isn’t going to be used.

This plugin stops the [Disqus plugin](https://wordpress.org/plugins/disqus-comment-system/)
from loading its javascript on pages or posts where comments are closed. If comments
are closed **and there are no existing comments already**, the JavaScript will be
stopped from loading. Note that to avoid breaking the existing functionality, the
JavaScript will still load if comments are closed but there are already some comments
on a page/post.

Based on http://thomasgriffinmedia.com/blog/2012/11/tame-disqus-comments-in-wordpress/

Disclaimer: This plugin is not affiliated with or endorsed by Disqus.

### If you need help with this plugin

If this plugin breaks your site or just flat out does not work, please go to [Compatibility](https://wordpress.org/plugins/disqus-conditional-js-load/#compatibility)
and click “Broken” after verifying your WordPress version and the version of the
plugin you are using.

Then, create a thread in the [Support](https://wordpress.org/support/plugin/disqus-conditional-js-load)
forum with a description of the issue. Make sure you are using the latest version
of WordPress and the plugin before reporting issues, to be sure that the issue is
with the current version and not with an older version where the issue may have 
already been fixed.

**Please do not use the [Reviews](https://wordpress.org/support/view/plugin-reviews/disqus-conditional-js-load)
section to report issues or request new features.**

## 安装

 1. Upload plugin file through the WordPress interface.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress.
 3. Load a page/post where comments are open and view the HTML source — the JavaScript
    for Disqus should be present. Then load a page/post where comments are closed —
    it should not.

## 常见问题

  How do I use the plugin?

Simply install and activate the plugin. It starts working immediately with no configuration
required. Pages and posts with comments disabled (and no existing comments) will
not load the Disqus JavaScript.

  I still see Disqus loading on pages/posts where comments are closed.

Are you caching the page or post in question?

Does the page or post already have comments on it?

Are you using a plugin (such as a caching or optimization plugin) that minifies 
or combines JavaScript?

## 评价

此插件暂无评价。

## 贡献者及开发者

「Disqus Conditional JS Load」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ jp2112 ](https://profiles.wordpress.org/jp2112/)

[帮助将「Disqus Conditional JS Load」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/disqus-conditional-js-load)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/disqus-conditional-js-load/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/disqus-conditional-js-load/)，或
通过[RSS](https://plugins.trac.wordpress.org/log/disqus-conditional-js-load/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/disqus-conditional-js-load/)。

## 更新日志

#### 0.0.4

 * updated .pot file and readme

#### 0.0.3

 * minor code optimizations

#### 0.0.2

 * fix for wp_kses

#### 0.0.1

 * created
 * verified compatibility with WP 3.9

## 额外信息

 *  版本 **0.0.4**
 *  最后更新：**12 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.5 或更高版本 **
 *  已测试的最高版本为 **3.9.40**
 *  语言
 * [English (US)](https://wordpress.org/plugins/disqus-conditional-js-load/)
 * 标签
 * [conditional](https://cn.wordpress.org/plugins/tags/conditional/)[Disqus](https://cn.wordpress.org/plugins/tags/disqus/)
   [javascript](https://cn.wordpress.org/plugins/tags/javascript/)
 *  [高级视图](https://cn.wordpress.org/plugins/disqus-conditional-js-load/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/?filter=1)

[您的评价](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/disqus-conditional-js-load/reviews/)

## 贡献者

 *   [ jp2112 ](https://profiles.wordpress.org/jp2112/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/disqus-conditional-js-load/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7EX9NB9TLFHVW)