How to “justify” text in a WordPress blog entry

Blogs tend to be left aligned. Why is this? The default is “left”. You have the option of “center” or “right” but unless you highlight and choose these you get “left“. ALL of my WordPress blog entries are justified. How did I do this? It involves switching between “visual” and “code” views.

  1. Enter your paragraph as usual in “visual” mode.

  2. Highlight the text you want justified and “left” align it. (“left” “center” or “right” make no difference here, it’s merely to get WordPress to write the code for you to alter, rather than writing the code yourself)

  3. Switch to “code” view and scroll down until you see you paragraph. It will have added HTML tags <p align=”left”>with the selected text in between</p>

  4. Now simply change the word “left” to “justify” so that it reads <p align=”justify”>with the selected text in between</p>

  5. Either “save” “publish” or switch back to “visual” view to see your preview changes. The “visual” preview area shows the alignment.

Until WordPress include a “justify” to sit alongside “left” “center” and “right” I’ll have to do things the long way. I personally think that the default should be “justify“.

Certain HTML code is allowed, while others are not. This is due to exploits skilled people can utilize to do damage to either the WordPress servers, or their clients blogs. I see no reason why a “justify” button couldn’t be added; for me the only downside of which would be that my blog would become less unique.

For those with web design software I can show you an easier way. I have a site set up within Macromedia Dreamweaver called “Blogs”. It will never be anything other than a code shop. I write my blog entry in Dreamweaver on a blank page, make all the alignment, highlighting changes, switch to code view…then copy and paste the relevant code.

For those who don’t have web design software, I’d recommend NVU which was designed for Linux but is available for all formats. Being from the Linux base point, it’s GPL license which means it’s free to download and use for as long as you like.

On a side note (but kinda related) those wishing to make their own headers but don’t have image manipulation software could do a LOT worse than GIMP. It’s the jewel in the crown of many Linux systems and an excellent program in it’s own right. It’s also under the GPL license and free. It has a “Script Fu” function allowing you to make banners VERY quickly and easily with NO previous skills.

Since this little trick involves replacing one word with another it’s worth noting why I use “left” over the other two. Count the letters; less to replace means a marginally quicker edit.

LEFT = 4 RIGHT = 5 CENTER = 6

Advertisements

2 Responses to “How to “justify” text in a WordPress blog entry”

  1. Jeremy Says:

    You don’t need to justify it that way. Depending on your browser, you can use either Shift+Alt+V or Alt+V to bring up the visual editor’s advanced toolbar. There will be a justify button there somewhere.

    Justifying the posts either my way or yours is not a very good solution technically, because if one day you decide you don’t like justification (e.g. if you switch themes where justification doesn’t look good anymore) you’ll have to adjust every single post to fix it.

    Plus, it uses deprecated markup. Every paragraph in your post starts with <p align="justify">, which is deprecated.

    A better solution (albeit slightly costly) would be to purchase the Edit CSS functionality for your blog and edit it there.

  2. Dirk Gently Says:

    I just tried both commands…SHIFT+ALT+V does bring up the advanced tool bar. I never knew about this. Thanks for that.

    As far as it being better to do it via CSS, I totally agree. I prefer CSS myself; it’s not an option for free WordPress hosted blogs….as you say, you need to pay for that option. My “how-to” was aimed at those (including myself for the time being) on the free hosted option.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: