从 Tumblr 主页中删除 Disqus 评论框,但为每个帖子的页面保留评论框?



我还没有在StackOverflow或谷歌上找到解决问题的方法,所以我想我应该问一下。

我将Disqus添加到我的自定义主题汤博乐博客中,但我想更改Disqus评论框/系统的显示位置。特别是,我不希望它出现在汤博乐的主页上,但我希望它能出现在每个帖子的页面上。所以,如果你去我的汤博乐主页,你会在底部看到Disqus系统——我想把它从那里删除。但是,我希望Disqus系统出现在每个帖子的页面上:看看它是如何出现在"第二个测试帖子"的唯一页面底部的。

任何关于如何实现这一目标的想法都将不胜感激。我所尝试的一切都只是从每一页中删除Disqus。非常感谢。

我的汤博乐HTML的正文如下:

<body>
    <div id="wrapper">
        <div id="headerleft">
            <h1><a href="{BlogURL}" title="read my thoughts">Blog</a></h1>
            <ul id="menu">
                <li><a href="http://michelemasiello.com" title="home">home</a></li>
                <li>&nbsp&nbsp|&nbsp&nbsp</li>
                <li><a href="http://michelemasiello.com/projects.html" title="check out my work">projects</a></li>
                <li>&nbsp&nbsp|&nbsp&nbsp</li>
                <li><a href="mailto:msm@michelemasiello.com" title="email me">say hello</a></li>
            </ul>
        </div>
        <div id="headerright">
            <p>"Everything has been thought of before, but the problem is to think of it again."<br>&#8212;&nbspJohann Wolfgang von Goethe</p>
        </div>
        <div id="recentposts">
            <ul id="postlist"></ul>
        </div>
        {block:Posts}
            {block:Text}
            <div class="post">
                {block:Title}
                    <h2><a href="{Permalink}">{Title}</a></h2>
                {/block:Title}
                {Body}
                <br>
                <ul class="like-reblog">
                  <li>{LikeButton color="black"}</li>
                  <li>{ReblogButton color="black"}</li>
                  <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                  <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                  <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                  <script type="text/javascript">
                    var disqus_shortname = '{text:Disqus Shortname}';
                    (function () {
                        var s = document.createElement('script'); s.async = true;
                        s.type = 'text/javascript';
                        s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                        (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                    }());
                </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {/block:Text}
            {block:Photo} 
            <div class="post">  
                <img src="{PhotoURL-500}">
                {block:Caption}{Caption}{/block:Caption}
                <ul class="like-reblog">
                    <li>{LikeButton}</li>
                    <li>{ReblogButton}</li>
                    <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                    <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                    <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                    <script type="text/javascript">
                        var disqus_shortname = '{text:Disqus Shortname}';
                        (function () {
                            var s = document.createElement('script'); s.async = true;
                            s.type = 'text/javascript';
                            s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                        }());
                    </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {block:PostNotes}{PostNotes}{/block:PostNotes}
            {/block:Photo}
            {block:Quote}
            <div class="post">
                {Quote}
                {block:Source}<br>&mdash;{Source}{/block:Source}
                <ul class="like-reblog">
                    <li>{LikeButton}</li>
                    <li>{ReblogButton}</li>
                    <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                    <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                    <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                      <script type="text/javascript">
                        var disqus_shortname = '{text:Disqus Shortname}';
                        (function () {
                            var s = document.createElement('script'); s.async = true;
                            s.type = 'text/javascript';
                            s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                        }());
                    </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {block:PostNotes}{PostNotes}{/block:PostNotes}
            {/block:Quote}
            {block:Link}
            <div class="post">
                <a href="{URL}" {Target}>{Name}</a>
                {block:Description}{Description}{/block:Description}
                <ul class="like-reblog">
                    <li>{LikeButton}</li>
                    <li>{ReblogButton}</li>
                    <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                    <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                    <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                      <script type="text/javascript">
                        var disqus_shortname = '{text:Disqus Shortname}';
                        (function () {
                            var s = document.createElement('script'); s.async = true;
                            s.type = 'text/javascript';
                            s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                        }());
                    </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {block:PostNotes}{PostNotes}{/block:PostNotes}
            {/block:Link}
            {block:Chat}
            <div class="post">
                {block:Title}{Title}{/block:Title}
                <table>
                    {block:Lines}
                    <tr>
                        <th>{block:Label}{Label}{/block:Label}</th>
                        <td>{Line}</td>
                    </tr>
                    {/block:Lines}
                </table>
                <ul class="like-reblog">
                    <li>{LikeButton}</li>
                    <li>{ReblogButton}</li>
                    <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                    <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                    <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                      <script type="text/javascript">
                        var disqus_shortname = '{text:Disqus Shortname}';
                        (function () {
                            var s = document.createElement('script'); s.async = true;
                            s.type = 'text/javascript';
                            s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                        }());
                    </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {block:PostNotes}{PostNotes}{/block:PostNotes}
            {/block:Chat}
            {block:Audio}
            <div class="post">
                {AudioPlayer}
                {block:Caption}{Caption}{/block:Caption}
                <ul class="like-reblog">
                    <li>{LikeButton}</li>
                    <li>{ReblogButton}</li>
                    <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                    <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                    <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                      <script type="text/javascript">
                        var disqus_shortname = '{text:Disqus Shortname}';
                        (function () {
                            var s = document.createElement('script'); s.async = true;
                            s.type = 'text/javascript';
                            s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                        }());
                    </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {block:PostNotes}{PostNotes}{/block:PostNotes}
            {/block:Audio}
            {block:Video}
            <div class="post">
                {Video-500}
                {block:Caption}{Caption}{/block:Caption}
                <ul class="like-reblog">
                    <li>{LikeButton}</li>
                    <li>{ReblogButton}</li>
                    <li>{block:NoteCount}<a href="{Permalink}#notes">{NoteCountWithLabel}</a>{/block:NoteCount}</li>
                    <li>{block:Date}<a href="{Permalink}">{TimeAgo}</a>{/block:Date}</li>
                    <li>{block:IndexPage}<a class="dsq-comment-count" href="{Permalink}#disqus_thread">Comments</a>
                      <script type="text/javascript">
                        var disqus_shortname = '{text:Disqus Shortname}';
                        (function () {
                            var s = document.createElement('script'); s.async = true;
                            s.type = 'text/javascript';
                            s.src = '//' + disqus_shortname + '.disqus.com/count.js';
                            (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
                        }());
                    </script>{/block:IndexPage}</li>
                </ul>
            </div>
            {block:PostNotes}{PostNotes}{/block:PostNotes}
            {/block:Video}
        {/block:Posts}

        {block:IfDisqusShortname}
        <div id="disqus_thread"></div>
        <script type="text/javascript">
            /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
            var disqus_shortname = '{text:Disqus Shortname}'; // Required - Enter shortname in Tumblr Theme Options
            var disqus_url = '{Permalink}'; 
            /* * * DON'T EDIT BELOW THIS LINE * * */
            (function() {
                var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
                (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
            })();
        </script>
        <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
        <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
        {/block:IfDisqusShortname}

        {block:Pagination}
        <div class="pagenav">
            {block:PreviousPage}<a href="{PreviousPage}">Previous</a>{/block:PreviousPage}
            {block:NextPage}<a href="{NextPage}">Next</a>{/block:NextPage}
        </div>
        {/block:Pagination}

    </div>
</body>

{block:IfDisqusShortname}之前添加{block:PermalinkPage},在{/block:IfDisqusShortname}之后添加{/block:PermalinkPage},如下所示:

{block:PermalinkPage}
    {block:IfDisqusShortname}
        //Disqus' code
    {/block:IfDisqusShortname}
{/block:PermalinkPage}

最新更新