Manually Patch Your Blogger Template

IMPORTANT: Make a backup of your template just incase you make a mistake modifying it. This way you have something to reference.

STEP 1

Add this to your CSS area or CSS file

        // Depending on your template, sometimes on some browsers, disqus doesn't auto-width 100% //
        #disqus_thread, #disqus_thread #dsq-content {
          width: 100%;
        }

STEP 2

        <b:if cond='data:post.allowComments'>
          <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:post.numComments/> Comments</a>
        </b:if>

        <b:if cond='data:post.allowComments'>
          <!-- <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:post.numComments/> Comments</a> -->

          <!-- +disqus -->
          <a class='comment-link commentslink' expr:href='data:post.url + &quot;#disqus_thread&quot;'>View Comments &#187;</a>
          <!-- -disqus -->
        </b:if>

STEP 3

(this is for: the 0 Comment; 1 Comment; 10 Comments. This shows up when viewing a specific post.) (Note: Some templates do not have this, so if you can’t find it, don’t bump your head :p instead, skip to the next step.)

        <b:if cond='data:post.numComments == 1'>
            1 <data:commentLabel/>:
          <b:else/>
            <data:post.numComments/> <data:commentLabelPlural/>:
        </b:if>

        <!-- <b:if cond='data:post.numComments == 1'> -->
            <!-- 1 <data:commentLabel/>: -->
          <!-- <b:else/> -->
            <!-- <data:post.numComments/> <data:commentLabelPlural/>: -->
        <!-- </b:if> -->
        Comments:

STEP 4

        <div id='backlinks-container'>

        <p class='comment-footer2'>
          <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a>
        </p>
  1. It may be enclosed on a DIV instead of a P element
  2. Sometimes its arranged differently, just look for any bits as shown on Step 4.1, also be sure it looks closely similar.
  3. Once you find it, change it to:

        <!-- <p class='comment-footer2'> -->
          <!-- <a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:postCommentMsg/></a> -->
        <!-- </p> -->

STEP 5

        <div id='backlinks-container'>

        <!-- +disqus -->
        <div id='disqus_thread'/>
        <div id='disqus_post_title' style='display:none;'><data:post.title/></div>
        <div id='disqus_post_message' style='display:none;'><data:post.body/></div>
        <script type='text/javascript'>
          var disqus_url = &#39;<data:post.url/>&#39;;
          var disqus_title = document.getElementById(&#39;disqus_post_title&#39;).innerHTML;
          var disqus_message = document.getElementById(&#39;disqus_post_message&#39;).innerHTML;
        </script>
        <script src='http://disqus.com/forums/DISQUS-SHORT-URL/embed.js' type='text/javascript'/>
        <noscript><a expr:href='&quot;http://DISQUS-SHORT-URL.disqus.com/?url=&quot; + data:post.url'>View the entire comment thread.</a></noscript>
        <a class='dsq-brlink' expr:href='&quot;http://disqus.com&quot;'>blog comments powered by <span class='logo-disqus'>Disqus</span></a>
        <!-- -disqus -->

Note: If above the code-bit on Step 5.1 there is </b:if>, then put the Step 5.2 code BEFORE </b:if>. If it isn’t there (there are some templates that doesn’t have it in that position), then just add it up.

Step 5.3: From the Step 5.2 code, change the DISQUS-SHORT-URL to well, your blog’s DISQUS URL.

Example: If your DISQUS URL is shortnname.disqus.com then change DISQUS-SHORT-URL to shortname.There are two to change!

STEP 6

        </body>

 * Right ABOVE it, add:

        <!-- +disqus -->
        <b:if cond='data:blog.pageType != &quot;item&quot;'>
          <script type='text/javascript'>
            (function() {
              var links = document.getElementsByTagName(&#39;a&#39;);
              var query = &#39;?&#39;;
              for(var i = 0; i &lt; links.length; i++) {
                if(links[i].href.indexOf(&#39;#disqus_thread&#39;) &gt;= 0) {
                  query += &#39;url&#39; + i + &#39;=&#39; + encodeURIComponent(links[i].href) + &#39;&amp;&#39;;
                }
              }
              document.write(&#39;&lt;script type=&quot;text/javascript&quot; src=&quot;http://disqus.com/forums/DISQUS-SHORT-URL/get_num_replies.js&#39; + query + &#39;&quot;&gt;&lt;/&#39; + &#39;script&gt;&#39;);
            })();
          </script>
        </b:if>
        <!-- -disqus -->

Step 6.3: From the Step 6.2 code, change the DISQUS-SHORT-URL to well, your blog’s DISQUS URL.

Example: If your DISQUS URL is shortname.disqus.com then change DISQUS-SHORT-URL to shortname.

STEP 7

Copy your final code to your Blogger’s Template and Save it.

STEP 8

Force Refresh your blog and blog-post to see the changes.

* Force refreshing tells your browser not to use your browser’s cache, instead fetch the files fresh from the server.

These instructions wre modified from Yukino's Guide

Patcher Ready Templates

Minima

Remove DISQUS from Blogger

Use any text editor (plain text mode) remove everything in between the following tags:

<!-- +disqus -->

<!-- -disqus -->

Once completed, DISQUS will be removed from your site.

BloggerHelp (last edited 2009-12-03 02:03:11 by daniel)