Hide Disqus on password-protected posts until password is entered?

I need to hide Disqus comments on password-protected posts until users enter the correct password. I’ve already contacted Disqus about this… first they told me to enable the disqus_developer variable. So I added this to header.php in WordPress:

<script type="text/javascript">
var disqus_developer = 1; // developer mode is on
</script>

But that didn’t do anything. Then Disqus support told me:

Read More

You would have to add some logic to your code that doesn’t load Disqus
unless the password is entered. This is something you would need to
customize in your theme/template.

They gave no direction on how to accomplish this. What do I need to do?

Related posts

Leave a Reply

1 comment

  1. Just edit plugins/disqus-comment-system/comments.php and add the following code somewhere at the beginning of that file:

    <?php if ( post_password_required() ) { ?>
    <p class="nocomments">Whatever text you want.</p>
            <?php
                    return;
             } ?>