Join 3,363 readers in helping fund MetaFilter (Hide)

Tags:

Selectively show Tumblr captions?
December 6, 2012 1:00 PM   Subscribe

Tumblr-filtr: is there any way to make some of my captions show up on the main page, and others just appear on the permalink page?

So, I have one of those 4-column themes which I'd like to be mostly just images. And my default setting is for captions to appear in the permalink pages only, but I'd like to have the option of being able to selectively showing captions on the front page. Is this not actually possible? Like, is it all or nothing with captions on index or permalink pages? I've been googling for an inappropriate amount of time to try to figure this out, but it seems like no one else is even asking this question.

This is the (I think, been a while since I messed with HTML/CSS) the relevant portion of code in the theme:

{block:Photo}
{block:IndexPage}
<img class="photoPost" src="{PhotoURL-250}" width="180"/>
{/block:IndexPage}
{block:PermalinkPage}
<a href="{Permalink}">
<img class="photo" src="{PhotoURL-500}" />
</a>
{block:Caption}
<div class="caption">{Caption}
{/block:Caption}
{/block:PermalinkPage}
{/block:Photo}
posted by hegemone to Computers & Internet (2 answers total)
 
Can you put HTML in a Tumblr caption? And can you have separate CSS for the index vs. the individual entry pages?

If so, you could manually type each caption inside a tag like:

<div class="hidden">Most captions go here</div>

Then on your main Tumblr page's CSS, hide the hiddencaption div:

div.hide {display:none}

For any captions you do want to have show up on the main page, just leave out the extra div when typing in the caption.

Don't format the CSS related to the new div at all on the individual entry pages, so it just inherits the regular caption styling. Then both kinds of captions will show up there as expected.

(This is kind of a messy solution as it mixes up semantics and presentation and purists would hate it and I don't really know what kind of logic you can use when constructing Tumblr themes. So there may be better ways to do it—I can think of a few in WordPress, where I'm better versed in writing theme logic.)
posted by bcwinters at 1:57 PM on December 6, 2012


It is a little "messy" but I think this'll work, thanks!
posted by hegemone at 4:36 PM on December 6, 2012


« Older If Steve Jobs never took a cal...   |  BookFilter: The sketchy detail... Newer »
This thread is closed to new comments.