Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

displaying a div only on tumblr blog homepage?

I have a fairly novice understanding of CSS and HTML, and I'm trying to do something that I think should be relatively simple (in a custom tumblr theme I'm creating), but I can't find a straightforward answer. I have a feeling there might be a super easy way to do what I want in JavaScript.

I'd like to display a DIV only on the main index page (i.e. homepage) of the tumblr blog. It seems the documentation tumblr provides allows you to do this to some extent (through the {Block:IndexPage} variable), but the problem is the code within this element displays on all index pages (i.e. instead of just showing up at the root level on /page/1, it will show up on subsequent "index" pages like /page/2, etc.

Here's the code I have, which successfully does not show the div on permalink pages:

{block:IndexPage}
    <div class="mid2">
        <div class="midLeft2">  
            <p>test</p>
        </div>   
    </div>
{/block:IndexPage}  

Any ideas? Any help is much appreciated!

like image 360
soobes Avatar asked Nov 21 '25 10:11

soobes


1 Answers

This will work:

{block:IndexPage}
  <div id="index"
    {block:SearchPage}style="display: none;"{/block:SearchPage}
    {block:TagPage}style="display: none;"{/block:TagPage}>
    This is displayed only on the index page.
  </div>
{/block:IndexPage}

More info: http://ejdraper.com/post/280968117/advanced-tumblr-customization

like image 119
Max Masnick Avatar answered Nov 24 '25 00:11

Max Masnick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!