When writing articles in WordPress, many people encounter this frustration: they clearly typed spaces at the beginning of each paragraph, but the published article shows everything flush-left! Today I’ll teach you a method to add spaces in WordPress that won’t be stripped out after publishing.
Method 1
- Switch to HTML mode (this method doesn’t work in Visual mode);
- Enable your Chinese input method (QQ Pinyin or any Chinese input mode will do);
- Press Shift+Space to switch to full-width mode (the sun icon in QQ Pinyin);
- Type spaces at the beginning of the paragraphs you want to indent;
- Publish or update to see the result (do NOT switch back to Visual mode at this point, or all your work will be lost).
Method 2
In the style.css file of your WordPress theme, find p {......} and add the indent code text-indent:2em; inside the braces, making it p {text-indent:2em;}. This achieves first-line indentation. (The downside is that every paragraph gets indented, even when you don’t want it to.)
However, I don’t recommend this method because any content between <p></p> tags will be indented by two characters — including h tags and other elements — creating unwanted indentation throughout.
Method 3
Use a desktop editor like Windows Live Writer to publish your blog posts. In WLW, to enable first-line indentation, go to the “Blog” menu, click “Edit Blog Settings”, select “Advanced”, change “Markup Type” to “HTML”, and save.
WLW is quite user-friendly and installs easily on Windows 7, though I’m not sure about other operating systems. That said, I still recommend using full-width spaces for indentation, as it follows proper Chinese typesetting standards.
PS: I originally had another method prepared for you involving HTML color codes in HTML mode. I’ve been using it for a while, but after testing just now, it no longer works in WordPress 3.2, so I won’t be sharing it.