Edit: this method only works with thumbs that don't have pages.
Set , Submit , and other pages created in the "Settings" section will be detected as "not found" with this code.
Description
Tumblr uses the regular {block:Posts} loop for static pages, but without assigning any variables like {PostID} . If we use a class like post{PostID} , on 404 pages of all static pages we will see the .post element, while in messages the elements will look like .post125678
Example
{block:Posts} <div class="post{PostID}"> {block:Photo}all your blocks here{/block:Photo} </div> {/block:Posts}
Using javascript:
var is404 = document.getElementsByClass('post').length;
CSS usage:
.post { }
Cool example without javascript
{block:Posts} <div class="post{PostID}"> {block:Photo}all your blocks here{/block:Photo} </div> {/block:Posts} <div class="fill-me"></div>
In CSS:
.post { display: none; } .post + .fill-me:before { content: 'This page was not found!'; font-size: 2em; }
Edit: possible fixes
To fix this method, we need to find the {tag} that only appears on pages, but not on 404 pages.
{ShortURL} , if this were not a mistake, it could be used, since in theory 404 pages should not have ShortURL.
I also tried {Permalink} , but in this case it behaves like {PostID} .
source share