从Tumblr主页上删除Disqus评论框,但保留每个帖子页面的评论框? [英] Remove Disqus comment box from main Tumblr page, but keep comment boxes for each post's page?

查看:110
本文介绍了从Tumblr主页上删除Disqus评论框,但保留每个帖子页面的评论框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有在StackOverflow或Google上找到解决问题的方法,所以我想问一下.

I haven't found a solution to my problem on StackOverflow or Google, so I figured I'd ask.

我已将Disqus添加到我的自定义主题Tumblr博客中,但我想更改Disqus评论框/系统的显示位置.特别是,我不希望它显示在Tumblr主页上,但是我希望它显示在每个帖子的页面上.因此,如果您转到我的Tumblr的主页,您将在底部看到Disqus系统-我要删除它从那里.但是,我希望Disqus系统出现在每个帖子的页面上:看看它如何显示在的唯一页面.

I added Disqus to my custom theme Tumblr blog, but I want to change where the Disqus comment box/system appears. In particular, I do not want it to show up on the main Tumblr page, but I'd like it to appear on the page for each post. So, if you go to my Tumblr's main page you will see the Disqus system at the bottom - I want to remove it from there. But, I would like the Disqus system to appear on each post's page: see how it appears on the bottom of "Second test post"'s unique page.

任何有关如何完成此操作的想法将不胜感激.我尝试过的所有操作都会从每个页面中删除Disqus.谢谢!

Any ideas on how to accomplish this would be appreciated. Everything I've tried just removes Disqus from every page. Thank you!

我的Tumblr HTML的正文如下:

The body of my Tumblr's HTML is below:

<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},如下所示:

Add {block:PermalinkPage} before {block:IfDisqusShortname} and add {/block:PermalinkPage} after {/block:IfDisqusShortname} like this:

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

这篇关于从Tumblr主页上删除Disqus评论框,但保留每个帖子页面的评论框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆