Aweber - Email Marketing Made Easy

Insert a Line Break in a Page Title in the WordPress Navigation Menu

March 18, 2011 · 4 comments

in WordPress

Thesis 1.x Notice: Thanks for reading this post! So, here's the deal. I wanted you to be aware that this post was written prior to the release of Thesis 2. So that means the instructions or other information provided applies specifically to Thesis 1.x and not the latest 2.x version. Thanks!

Here’s an interesting one. You might have seen some navigation menus around where the page titles have a second line of text below the title. It’s usually done to show the main page title, and then some sort of sub title or secondary text on a second line under the main page title.

So how can we accomplish this?

Upon first glance, it seems that the logical solution would be to add a line break in the page title to create two lines of text, but if you insert a <br /> tag in the title of your page, will that actually work? Well, yes it will, but it isn’t recommended because it could be problematic with respect to your RSS feed since the tag would likely show up as text. Furthermore, you might not want to include that secondary line as part of your page title anyway.

Add a line break to a page title in your navigation menu in WordPress

Here is a preferred method for doing this. As it turns out, the “Navigation label” field in WordPress menus will accept HTML code. Who knew!? You can read more about How to Use WordPress Navigation Menus in Thesis. Once you have it working on your site, all you do is add your HTML tags to the “Navigation lablel” field for each menu item.

Add a line break to page titles in WordPress navigation menu

Adding the line break is one way to do it, but I prefer using a <span> tag. You could then target the second line and style it how you wish. Here’s an example of the css you could use:

.custom .menu a span { display:block; font-size:12px; }

If you know of a different or better way of achieving this, let us know in the comments.

Was this post helpful? Consider subscribing to my blog via RSS or

This Site Runs on the Thesis WordPress Theme

Thesis Theme thumbnail

If you're someone who doesn't understand a lot of PHP, HTML, or CSS, Thesis will give you a ton of functionality without having to alter any code. For the advanced user, Thesis has incredible customization possibilities via extensive hooks and filters. And with so many design options, you can use the template over and over and never have it look like the same site.

If you're more familiar with how websites work, you can use the fantastic Thesis User's Guide and world-class support forums to make more professional customizations than you ever thought possible. The theme is not only highly customizable, but it allows me to build sites with a much more targeted focus on monetization than ever before. You can find out more about Thesis below:

{ 4 comments… read them below or add one }

rakesh@rsatechnologies.in March 20, 2011 at 12:15 am

This is very interesting article i have seen. I am new to thesis customization but would love to implement in my site. Thank you very much . One more off beat question. My site is not able to show thumbnails on the front page teaser, but it display the image in the single post. Please Guide me.

Reply

Thesis-Blogs.com March 20, 2011 at 3:32 pm

I’m not sure what system you’re using to show the teaser thumbnails, but I mostly use WordPress Featured Images for this. If you’re using the built-in Thesis thumbnails then there’s a few things that need to be in place for it to work right. You can do a Google search for this as there’s a few tutorials for it online. You could also check the DIYthemes Thesis User’s Guide. If it helps, here’s how you can do it using the WordPress Featured Image function:

add_theme_support( 'post-thumbnails' );
add_image_size( 'teasers_thumb', 150, 150, true );

function teasers_thumb() {
	if(has_post_thumbnail()) :
		the_post_thumbnail( 'teasers_thumb' );
	else : endif;
}

add_action('thesis_hook_before_teaser_headline','teasers_thumb');

Of course you’d need to style this how you’d like and also set the thumbnail image size to suit your needs.

Reply

Rick Anderson March 27, 2011 at 5:46 am

Excellent article! I’ve used the <br /> trick before and also a span tag with an inline style in the Thesis Nav Menu. However, your suggestion is so much better than that. Thanks for the article.

And way to go with the html tag posting instructions! That’s totally cool.
Rick Anderson recently posted..WordPress and Thesis as a Complex CMS

Reply

Thesis-Blogs.com March 27, 2011 at 9:13 am

Hi Rick, thanks for commenting and good to know that you enjoyed the post.

Reply

Leave a Comment

When commenting, you can use basic HTML tags. If you are pasting in any code, please escape it here and then include that code within <pre></pre> tags. Thanks!

CommentLuv badge

Previous post:

Next post: