Tumblr is a pretty interesting mini-blogging platform that's getting really popular recently. But with RTL, it's horrible! In the text editor, you cannot even right align your text and it strips off any inline styles if you try to add it yourself (I know!! totally unacceptable). In this tutorial I'll show you how to RTL your Tumblr theme completely or have it bidirectional.
Despite the poor and sad RTL support the Tumblr editor has, we have full access to the theme HTML/CSS template. So in order to RTL any Tumblr theme, all we need to do, is finding that template HTML/CSS and flip its CSS. Here's how:
head tag. Just go through it by flipping the directional rules(Refer to this tutorial for detailed steps)Unfortunately I couldn't find any ready RTL Tumblr themes online(please do send me any links if you find any) so I guess it's our only way to get RTL Tumblr themes.
Now this might be a more popular type of Tumblr blogs in the area. I personally post in both Arabic and English in my Tumblr blog so I need it to be bidirectional to some extent where I can -at least- control the text direction of the Arabic/English text selectively. Follow the below steps to add RTL support:
{block:Posts} and {/block:Posts} for div(s) with the class "post":<div class="post">
..and add the class {TagsAsClasses} with the braces as below:
<div class="post {TagsAsClasses}">
What this does is adding CSS classes to the post blocks dynamically according to the tags you add to your post (see where we're going with this?)
.arabic and add our RTL rules to it. While we're still in the customization page, switch to the Advanced section in the toolbar(the last one at the bottom) and add the below in the "Add Custom CSS" block
.arabic /*or whatever class you wish to use*/
{
direction:rtl;
text-align:right;
font-size:1.1em;/*arabic fonts tend to render smaller*/
}
So to wrap it up, we used the {TagsAsClasses} dynamic tag Tumblr offers to differentiate posts from one another even if they're of the same type. And by using also the custom CSS we can add, we created an instant RTLing process which gave us a somehow bidirectional Tumblr blog.
I also found an Arabic RTLed Tumblr post talking about this second solution; check it out.
There are currently 0 users online.
Comments
Ron Barak (not verified)
Sat, 05/02/2011 - 20:49
Permalink
A usage example please...
Hi,
Would you mind adding an example to explain "Now you're all ready to use your little RTL system we created. Create a new post, and just tag it with "arabic" or whatever class you choose. And Voila!" ?
Thanks.
nightS
Sun, 06/02/2011 - 16:50
Permalink
Example
In your tubmlr dashboard, create a new post and in the "tags" box on the right, add the tag "arabic" and save your post.
Ron Barak (not verified)
Sat, 05/02/2011 - 21:32
Permalink
Is there a way to put RTL text in the title, right justified ?
Is there a way to put RTL text in the title, right justified ?
Thanks,
Ron.
Natalie (not verified)
Sat, 16/07/2011 - 18:41
Permalink
Hi,
Hi,
Thank you for the great tutorial. I linked to this post in my Tumblr.
Do you know how to take care of the date? for some reason, the theme won't show the date when I do this RTL trick...
Thanks,
Natalie
nightS
Mon, 18/07/2011 - 09:35
Permalink
Strange!
Thanks for your feedback =)
The date thing is strange! Which theme are you using?
Nicole Kidman's (not verified)
Tue, 09/08/2011 - 04:18
Permalink
hi
Great post. Very informative and useful as well. I just want to ask if is there a way to put RTL text in the title, right justified ?I am looking forward to visit here again..
shmolik katz (not verified)
Fri, 12/08/2011 - 11:51
Permalink
works great!
Thank you.
Shuaib Alise (not verified)
Sun, 11/09/2011 - 22:11
Permalink
Need help :(
Hi,
Was going through the steps but for some reason I cannot find <div class="post">. Would there be a reason for that.
nightS
Mon, 12/09/2011 - 09:40
Permalink
If you're familiar with HTML,
If you're familiar with HTML, try looking for the <div> that wraps the post structure. What's the theme you're using? I can help you find it.
Lana (not verified)
Tue, 25/10/2011 - 04:57
Permalink
Desperately need help
Hey, NightS I'm starting a blog on tumblr and i'm so frustrated because i can't post text from right to left, and i'm very unfamiliar with HTML so i tried to follow your steps, but i'm totally lost. I'm trying to post in arabic too. I'd like it bidirectional so i can also post in English. I'm using the "Esquire" theme. this is so confusing. Is it possible that someone can do it for me?
Aphrodite (not verified)
Sat, 07/01/2012 - 02:14
Permalink
there is no CSS in my html
Hi,
When I choose my theme, instead of "customize Html" as you said, I have "edit html". Even when I click on that and see the code, I do not find "css" in the script. Are you using a specific theme?
I would be grateful if you reply since I also want to have some posts in Persian and some in English.
Thanks,
A
nightS
Sat, 07/01/2012 - 12:04
Permalink
To Aphrodite
Hello,
tag(in the beginning of the script). Is there a link of the theme you're using so I can check it for you?Tumblr people have changed the interface. It's now "Edit HTML", thanks for pointing this out, I'll update the post.
Now, the tutorial I wrote should apply to all tumblr themes not just a specific one. Which theme are you using? The style is usually in the
Aphrodite (not verified)
Sat, 07/01/2012 - 23:48
Permalink
support for right to left languages
Hi again,
I have a few questions.
1- Do I have to follow procedures under both titles: "RTLing any Tumblr theme" & "Adding RTL support to a Tumblr theme" or just the second one if I want to have a bidirectional blog based on my posts which I tag?
2-In your "3 Different Ways to RTL your CSS", on the third option, you're talking about 2 files. Where are they located? As I understand there is only one file for themes to be customized.
3- I flipped all "left"s to "right"s but I still see the ! and . marks on the other end of the sentence.
4-You mentioned to go in "advanced tab" to "Add Custom CSS" block. There is no such tab. Where in the html file should I add the code for defining the tag class?
5-Can I see the bidirectional blog you're writing?
Thanks,
Aphrodite
nightS
Sun, 08/01/2012 - 12:10
Permalink
Answers
Hello again =)
1- No if you have a bidirectional blog use the second one.
2- You don't need flip any of the styles(since you're only adding support). But if you want to totally RTL a tumblr theme, use the first method not the third. Since the styles are all in one place inside the
Aphrodite (not verified)
Sat, 07/01/2012 - 23:49
Permalink
another thing is that when I
another thing is that when I type the title in persian it doesn't show up in the published post
nightS
Sun, 08/01/2012 - 12:11
Permalink
cufon of sIFR?
The theme might be using a font replacement framework that uses flash or images. Usually the fonts used don't include the Arabic or Persian characters. Try disabling that if you're familiar with these tools.
Aphrodite (not verified)
Sun, 08/01/2012 - 21:07
Permalink
still some questions!
Hi again nightS,
I guess your first answer was ended incompletely! So I am only adding an RTL to the theme. I'm using Stationary as a theme. In this theme, I do not find <div class="post"> in between {block:Posts} and {/block:Posts}, or in the whole code for that matter. Can you tell me where I should add this?
Also as I said, there is no option for "Add Custom CSS" block. Where and how do I add the code for that?
my email is cytherea5@gmail.com. If you want you can send your reply there.
Thanks again,
Aphrodite
Aphrodite (not verified)
Sun, 08/01/2012 - 22:27
Permalink
problem solved but some suggestion to you
Hi nightS,
After a few hours struggling with trials and errors I could render the "stationary" as you said. But why struggling? Because I could not find <div class="post"> in the code, not only in this theme but in a lot other themes I looked at. So what I did was to create this line myself right after {block:Posts} and close it with </div> right before {/block:Posts}.
I don't know if the logic is right from programming point of view (i'm a dummy in html), but this worked for me and I hope won't have problems later. So what I suggest to you to change in your tutorial is to add this section for people who read your very useful tutorial.
Good luck
Aphrodite
Add new comment