You may have seen those fancy templates, that display on the main page a snippet of the post's text along with a thumbnail of an image inside the post. Maybe you want something like that only from time to time, so installing a new template for that would be overkill and maybe constrains your other options. I will show you how you can do it with a little javascript or CSS for example in Simple template.
Now the whole post text is opened, and the big image is showing instead of the thumbnail.
This is accomplished with some simple javascript or CSS, which is placed near <--more-->. If using javascript, the start of this post looks something like this:
The trick is to show the thumbnail on main page (if javascript is enabled), and hide it again when the whole post is opened (when we go past <!--more-->). I used here also the jump break hack (first html line of the post). If javascript is not enabled, then we fallback gracefully to only showing a snippet of the post's text on the main page.
Update Jan 7th 2012: As Beben suggested in comments, this can be done with only CSS, no javascript required. Show the thumbnail by default, and after we go past <!--more--> we'll introduce a new style for the thumb, which forces it to hide. Nice. Looks something like this:
This post uses now the CSS solution, but the javascript solution is visible in the source too, but the code lines are commented out.
Click on a single comment to hide/show its text
2 comments:
I'm using old editor post :D
but, that can do use CSS too ;)
@Beben Koben
Thanks, did not think about that. I added also a CSS only solution to the article.
See the hack to make the 'Post a Comment' link bigger.
Post a Comment