Site Meter Web Dev Notes » Blog Archive » Formatting Text in Wordpress

Formatting Text in Wordpress

by Deceth

Wordpess LogoI’ve received questions from several individuals with regards to how I am able to include HTML code in my Wordpress posts. For example, if you want to make a word bold, you type <strong>bold</strong>. So the question is, how then did I write <strong>bold</strong> without the word becoming bold? The other questions I’ve been asked is, “How the heck did you do that indentation?!”. Take a look at this post for example! Can you put blocks of code like this on your page? YES!

The magic behind formatting a post like this is actually very simple. Writing a post in Wordpress is a simplified way of inserting a few paragraphs of HTML formatted text into a web page. When you make a word bold or add a link, the text is surrounded by tags which will tell the browser how to format it’s appearance on the screen. HTML tags always begin with “<”, so as soon the browser encounters this symbol, it will check to see if it is a valid HTML tag, and if so, take the appropriate actions. If you actually just want to display the “<” symbol on screen and have the browser ignore the possibility that it could be HTML code, then you need to instead write the ASCII entity name.

I know many of you just grumbled and felt discouraged at the mention of ASCII entity names, but don’t worry I promise it really is very easy! Basically, all you need to know is that some characters have an ASCII entity name which you can type in your posts to display the character. For example, the ASCII character name for < is:

&lt;

Try it out! Open up wordpress and type the above ASCII character. When you preview the page, you will see that the character < is displayed instead. The new mystery then is, how did I write the ASCII character above without it being turned into “<”? hmmm…!

The next question was related to indentation in posts. The first thing I did was put my code within a blockquote. If you are using Wordpress, you can simply highlight text, then click the “b-quote” button to do this. This indents a whole paragraph of text, commonly used for quoting references by bloggers. Next, I surrounded my blockquote with a tag called <pre></pre>. This tag is used to define preformatted text which means that the text enclosed between the tags will be displayed as it is typed. In a nutshell, if you are typing a post in Wordpress and hit the spacebar 20 times between each word, when you hit preview, it will still only show a single space between each word. However, if you use <pre>text to be preformatted here</pre> in your post, then all text between the tags will display your text as it was written, meaning multiple spaces can be displayed.

Try it out. Copy/Paste the below into Wordpress and preview it to see the effect:

<pre>

This is the first line, with no indent.
     This line has 5 spaces in front of it!
          This line has 10 spaces in front of it!

</pre>

Enjoy!

Update:I’d just like to say it’s really interesting how this post first came to be. The only reason I thought about writing on this subject is because readers contacted me asking about it. I am very eager to answer any and all such questions! Please keep the feedback coming so that I can focus on providing content that is of interest to YOU!


6 Responses to “Formatting Text in Wordpress”

  1. Ren Says:

    Great tips. That one was bugging me.

    Thanks

    Ren

  2. Web Dev Notes » Blog Archive » How To Move a Wordpress Blog to a Different Directory Says:

    [...] How To Move a Wordpress Blog to a Different Directory by Deceth Last week I decided to move a blog to a different directory on my web server. Doing so actually turned out to be quite easy thanks to the way the Wordpress developers have set things up! In fact, moving your blog is easier than formatting text in Wordpress! [...]

  3. cheritycall Says:

    How are you?, Give something for help the hungry people in Africa and India,
    I created this blog about that subject:
    on http://tinyurl.com/5qlbzs

  4. Levi Says:

    PmMdhOqDbJsDU

  5. stock Says:

    OHH Great post! I’m loving your website;

  6. broker Says:

    OHH Great post! I’m loving your website;

Leave a Reply


About Web Dev Notes

Your one stop destination for anything and everything related to web development

Web Dev Notes Author(s)
    » Deceth

Blogging Flair

New Media, Web 2.0 Channel Posts

  • 10 Ways to Make Sure Your SEO Goes Out of Its Way for You
    If they want to have success, companies should do everything they can to ensure that their SEO firm doesn't provide lousy service. Here are 10 tips to keep in mind: 1. Be realistic. Don't waste your [...]
  • Podcasting Transcription
    A Guest Post from Tishia Lee of Tishia Saves Time: When I first started offering transcription services as part of my Virtual Assistant business, transcribing podcasts was not something I [...]
  • Don't Dabble - Make A Commitment
    If you want to get the best bang for your buck, plan on podcasting for the long haul. Podcasters who “test” things out with one or two podcasts and then give up may think that they've given [...]
  • A Question of Podcasting Frequency
    This follows up on yesterday's post about not dabbling in podcasting but rather to make a commitment. Podcasting on a schedule is important when building a community and an audience. Don’t have [...]
  • Do You Twitter About Your Podcast?
    Whenever I release a new episode of Work at Home Moms Talk Radio is pop the link up on my Twitter and invite my followers to come check it out. This has brought me several first time listeners which [...]
  • Looking for Podcast Outsourcing?
    I mentioned having my podcast audio's transcribed in my last post. In case you wonder - no, I do not transcribe them myself. (Shudder the thought - I did enough transcription to last a lifetime in [...]
  • Business Podcasting Benefit: Be An Industry Thought Leader
    I often ask people 'Why haven't you started your podcast yet?' and a common reply is 'I don't feel like I'm enough of an expert to cover the topic I'm interested in.' Enough of an expert? [...]
  • Business Podcasting Benefit: More Content
    Building a business on the web requires that you generate a lot of content. Content on your website draws traffic both through search engines (people searching for your content) and through links [...]
  • Business Podcasting Benefit: Deeper Relationships
    A website visitor is just a website visitor. You can't really say that you have a relationship with someone who has only visited your website can you? But when the web visitor subscribes to [...]
  • Business Podcasting Benefit: Increased Market Exposure
    When you consider how many millions of people are walking around with iPods and other Mp3 players you have to wonder, wouldn't it be awesome if they came looking for you? Well they do. Ipod [...]

Hot Off The Press

  • Friday Free for All - Communication
    Hello and welcome to the Friday Free-for-All! Inspired by the Weekend Soiree over at Wifely Steps (and pretty much using her idea, to be honest, but you can go over there and play on her site as [...]
  • Happy Birthday, Thomas Gibson!
    Here's a picture of Thomas Gibson looking all smiley, which I thought was appropriate for his birthday. Wish Thomas the best, and have a happy Third and Fourth of July! Have a safe weekend and [...]
  • New Spin Cycle: Sting, Jeff Jarrett, Jim Cornette, Don West
    JB is back with the latest edition of "TNA Spin Cycle", featuring Sting, Jeff Jarrett, Jim Cornette and Don West. [...]
  • Angelina Jolie=Top Earning Actress
    That Forbes is at it again. They do love their polls and surveys. This time around it's not the most powerful title that Angelina garnered but highest paid actress. According to the financial [...]
  • QWSTION Office Bag
    Don’t forget your office essentials, connect to business as-you-go. The two-way access reveals a separate 17-inch laptop compartment with neoprene padding for extra protection. Front section [...]
  • HTC Hero
    For HTC and Android, third time's a charm. The HTC Hero is the handset giant's third Android phone, but arguably their first lust-worthy effort. Continuing the chin motif of the company's [...]
  • Volleyball's Schlagintweit and Meek selected to Senior Canadian Volleyball roster
    After two weeks of intensive training following the selection camp held last month, the roster for the Senior Women's National Team has been determined. Nineteen players have been selected by Head [...]
  • Movie Review - "Public Enemies"
    ** STARS In the action-thriller "Public Enemies", acclaimed filmmaker Michael Mann directs Johnny Depp, Christian Bale and Best Actress Academy Award winner Marion Cotillard in the story of [...]
  • Little things
    There are a lot of things that suck about being a part time dad. Not having him here all the time. Going half days on holidays and birthdays. The big stuff that you think about when seperated parents [...]
  • Interviews are going up!
    At long last! We have interviews going up at CBS2! So check it out here, as Diane interviews. It's hard to hear Diane, as usual, so up your volume a bit! (I'm sure someone will youtube them too - [...]