1955 Design - Web Design - WordPress - Rochester 48307 | Rochester Hills 48306 | Oakland County Web Design

Michigan WordPress Website Design

  •    
  • Team
  • Work
  • Process
  • Cost
  • News
  • Contact

Optimize WordPress Page Headings

September 14,  2007 by David Zemens

Note: This post has been republished due to new interest in it. In addition, more detailed information and instruction has been included with the post.

I have always thought that one of the main flaws of many WordPress themes is that the main Page navigation, when called by using the wp_list_pages() function, applies a title to each of the navigation links with whatever value is used in the the_title() of that particular Page.

Wouldn’t it be great if you could have a Page title that was more descriptive than the short title that WordPress wants to display in your navigation link?

Don’t get me wrong, this is a good idea, but because of the way most navigation links are designed, the page titles need to be quite short and not very descriptive. Similarly, these themes tend to also use the_title() as the main H1 or H2 tag for the page display itself. In other words, if the navigation link says “Home”, the page title for that page usually displays as “Home” as well. This may be the way a designer wants it, but often it seems that a more descriptive page title is what’s really needed.

By applying a nice bit of coding and sharing it with the world, Mike Cherim gave me the idea about how to solve this problem. I adapted the code he uses to display WordPress pull quotes, and now use it to afford the WordPress user the option to add their own, more descriptive page title rather than relying on the_title() alone. By using Mike’s technique, along with the built in custom fields feature of WordPress, the user is not required to to add a more descriptive page title, and if they don’t, the code defaults to using the_title() as normal. However, it does afford the user the option to be more descriptive in their page titles. Not only is this a neat feature that allows for more descriptive titles, but it also allows for keyword insertion into these WordPress Page titles – something that can only increase page rankings in the search engines. After all, which H1 page heading is more SEO friendly, “Home” or “Welcome to LifePlan Financial“?

The code below shows how I implement thee page titles in the PHP code. (Sorry, I could not get the actual PHP code to display correctly in this post, so what you see below is an image.)

main_title.jpg

Essentially, the code above says the following: If the custom field named main_title is NOT empty, display the text contained in that field as the H1 title. If the custom field named main_title IS empty, display the standard WordPress the_title() tag as the H1 title.

Putting the Code to Work for You

Based upon our example above, let’s put this into action. We’ll add one custom field called “main_title”. The following instructions will demonstrate how to add this information to a post using Custom Fields.

  1. From the Write Post panel, choose Advanced Editing. If you are using the Simple Editing screen, look for a button with Advanced Editing next to the Publish button. Click the button to go to the advanced editing screen.
  2. After you have written your post, scroll down to the bottom of the Advanced Editing screen and look for an area titled Custom Fields.
  3. To create a new Custom Field called “main_title”, enter the text “main_title” (without the quotes) in the text entry field titled Key.
  4. The newly created Key should now be assigned a Value, which in our case is the name of H1 title you would like displayed on your page. Type this text in the Value field, again without the quotes.
  5. All done. If I explained this correctly, and you followed the directions, your WordPress pages will now display the custom page title field!

You can add a page title to each of your WordPress pages meta-data. In the Custom Fields section, the Key will now feature a pull down list with the previously entered Custom Fields. Choose “main_title” and then enter the new page title in the value. Click Add Custom Field.

You only need to create a new “KEY” once, after which you can assign a value to that key for every post, if you so desire. If you do not enter any value in the main_title key, the code I wrote will default to using the standard WordPress page title contained in the_title() function

You can see this technique in action right here at 1955 Design. Just navigate the menu and see what titles I have chosen to add to the pages, rather than just the default navigation text. I think it’s a great idea, and thank Mike for both the code and the concept.

[eof]

Filed Under: WordPress

About David Zemens

Web designer. Lover of all things WordPress. Semi-professional dog walker. Recovering iPhone addict. Husband. Father. Grandfather to Zoey, Jacob & Andrew. Not necessarily in that order.

Let’s Get Started Today!

I am currently taking on new projects and would love to hear from you. Get in touch with me today and learn how I can put all the pieces together for your new website. You'll soon find out that I'm good at working puzzles.

Stuff I’m Talking About

  • Rochester Hills Michigan Web Design
  • David McElroy
  • 5 Signs You Need a New Website
  • Most Blessed Sacrament Cathedral
  • Miss Madison Unlimited Hydroplane
  • Great CPA Websites
  • Feedburner
  • What Now?
  • Believe in Miracles
  • WordPress Custom Fields

Get Social

  • Email
  • Facebook
  • Twitter

I Work Here

Map of our location

Even though I work in metro Detroit, I have worked with clients from Seattle, Washington to Jacksonville, Florida. That pretty much covers all the United States.

I can work with your project, too!

Where Are You Located?

I am located in Rochester, Michigan but have worked with clients from coast to coast. Distance is never a problem. I’ll communicate with you quickly and you’ll feel that I’m just around the corner – no matter the distance between us.

1955

I was born in 1955. I'm old enough to remember the internet before "www" was around. Just white text on a black screen. No graphics. This means I'm experienced. Why not use my experience to your advantage?

Ready to Start Your Project?

I am currently taking on new projects and would love to hear from you. Get in touch with me today and learn how I can put all the pieces together for your new website. You'll soon find out that I'm good at working puzzles.

Etcetera

  • Site Info
  • Site Map

Connect With Me

Learn more about what I've got to say. Talk to me. Share something. Learn something. Get social. Or if you'd prefer you can contact me in more traditional ways, too.
  • Email
  • Facebook
  • Twitter
Follow @1955Design

Find It

1955DESIGN · Rochester, Michigan · (248) 830-7393
© 2005–2023 · 1955 Design · All Rights Reserved · Admin
1955 Design builds websites with WordPress and the Genesis Framework