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...
Add Disqus To Your Tumblr Alternately, if you're logged into Tumblr, simply browse to Tumblr.com/customize. On the Customize page, select the Appearance tab. Scroll down to the bottom of that list, and paste your Disqus shortname in the Disqus shortname box.
Disqus is a free commenting system that allows a greater way of communication with fellow blogs on Tumblr. To get started, sign up for an account on Disqus here, once the registration is complete, simply type in the short name you chose into the "Disqus Shortname" text field in theme customisation under theme options.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With