As far as I am aware in Tumblr there is no {block:Pages}
block, so anything we add to normal posts is added to pages as well, things like sharing and worst of all, comment systems.
Does anyone know of a hack, or any way to remove/hide elements from pages? It's difficult because pages are using the {block:Permalink}
{block:Text}
blocks, so I'm pretty stumped.
I recently just discovered how to modify CSS with post tags using just HTML over here: Tumblr: How to control CSS with post tagging (UPDATE: Working Method without JQuery!)
I thought maybe we can use this, the idea would be something like this:
{block:Text}
<div class="post {block:HasTags}pagefix {block:Tags}{Tag}{/...}">
...
{/block:Text}
The way it works is by default we hide any element we don't want to be shown on pages (example: Disqus), adding the class .pagefix
between {block:HasTags}
in the div wrapper we can tell it to show elements on posts with tags, that way elements will only be shown on posts and not pages, because pages don't have tags.
Two problems with this, 1) all posts MUST be tagged in order to show any hidden items and 2) the Disqus comment script would have to be inserted into every post type, rather than just once before the {/block:Posts}
end block.
I may be just placing Disqus in the wrong place, or some other error, let me know what you think, I can't find anything at all about this on the net anywhere. It's so dumb not to have a unique page block...
Simply wrap your Disqus code in the date block.
{block:Date}
<!-- Disqus code -->
{/block:Date}
Since only posts have dates, the Disqus code will never get rendered on a page. This also solves the problem above where having only one post breaks the method.