Last active
January 1, 2016 09:38
-
-
Save diklein/8125796 to your computer and use it in GitHub Desktop.
Debut Tumblr Theme: How to show content *only* on the homepage. My goal is to place a few paragraphs of text above the blog posts on the homepage. The text will not appear on tag pages, search pages, or other index pages. Check it out on diklein.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.hidden { display: none; } | |
</style> | |
{block:IndexPage} | |
<div id="index" {block:SearchPage}class="hidden"{/block:SearchPage}> | |
<div class="content {block:TagPage}hidden{/block:TagPage}” role="main" id="introtext"> | |
<article class="post post-type-text"> | |
<div class="container"> | |
<div class="post-body wysiwyg"> | |
<p>Text!</p> | |
</div> | |
</div> | |
</article> | |
</div> | |
</div> | |
{/block:IndexPage} | |
<!--{block:Posts}--> | |
<script type="text/javascript"> | |
if( {CurrentPage} != 1 ) { | |
document.getElementById("introtext").className += " hidden"; | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extra quote on line 20. Also you should add " hidden" in case there's already a class there.