WordPress Headlines and HTML

QuickTip: Adding Line Breaks and Other Styles To The WordPress Headline

by Jesús Ramirez, Follow him on Facebook!
Posted in Quick Tips, Wordpress

I recently wrote an article tittled “Slippery Slides For Fun & Profit!“.

The headline to this article broke weird on my page (see image below)

The word "profit" is alone in one lineThe word “profit” was left alone in one line, and what I wanted was to have “slippery slides” in one line, and “For Fun & Profit!” in another.

But how would I add a line break to my headline?

After all, hitting “enter” on my keyboard would not make the break on my headline.

Well, the answer is simple.

Simply add some HTML to your headline’s input box when you are creating or editing your article.

<br/> is all you need:

Adding a break to your headline

by adding <br/> to your headline input box, you can control where your lines break, making more visually appealing headlines

Headline with nice line breakOther Useful HML Tags You Can Use On Your WordPress Headline:

Bold your text:
<strong>Your Text</strong>Example.

Emphasize your text:
<em>Your Text</em> →  Example.

Strike your text:
<strike>Your Text</strike> → Example.

Underline your text:
<u>Your Text </u> → Example.

Create a superscript:
<sup>Your Text</sup> → E=MC2.

Create a subscript:
<sub>Your Text</sup> → H20.

You could also add a style tag to these HTML tags to further style your headline without changing all the other headlines on your page.

For example if you just wanted a single word on your headline to be underlined and red; this is the code you would use:

<u style="color:red;"> Word </u>

Fixing Your Broken Breadcrumbs

If you decide to add HTML to your headlines, this might cause problems with your breadcrumbs.

Breadcrumbs usually add the_title() tag which works fine, but it renders any HTML code apply to it.

A better tag to use on your bread crumbs is the  the_title_attribute()

The title attribute also displays your title, but it strips away all your HTML tags.

If you enjoyed this article, get email updates (it's free)

Other Posts You Might Like:


{ 4 comments… read them below or add one }

Rochelle October 17, 2011 at 12:22 pm

This was just what I was looking for. Big thank you. Just came across your blog- bookmarked. Very helpful post. Keep it up! Have a good day :)

Reply to this comment

Jesús Ramirez October 17, 2011 at 3:45 pm

No Problem Rochelle,

hope to see you back here again soon!

Reply to this comment

Pj Zafra October 17, 2011 at 3:22 pm

Hey Jesus,

Great post here! Thanks for the tips. This same issue you had happened to me a couple of times. Thanks again and keep it up! :D

Reply to this comment

Jesús Ramirez October 17, 2011 at 3:46 pm

Pj,

I see that a lot of people have a problem with this!

Thanks for the comment :)

Reply to this comment

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

You have to use a valid email address To subscribe to our newsletter. Youll receive a confirmation email to make sure your email address is valid and working, clicking the link will automatically add you.

Links in comments that are not related to the topic (such as "signature links") will be deleted. Use your real name, if you use "keywords" instead of your real name your comment will be deleted. Anonymous commenting is not allowed.

Loading Quotes...