Welcome to Adult Webmaster Forums News Resources & Tips - Adult Forums 247 Mark forums read | View Forum Leaders
Adult Webmaster Forums News Resources & Tips - Adult Forums 247



Reply
LinkBack Thread Tools Display Modes
Using More Descriptive Titles In Pages
 
 
I Don't Bite...Much
VoyGeorge's Avatar

Reply With Quote
 
Join Date: Mar 2009
Location: Somewhere, Out There
Posts: 1,255
12-04-2009, 07:04 PM
 
Most themes are set so that the title you provide for a post or page is how it's displayed in a post or page list elsewhere on your blog. It's okay for posts, because the layout of most blog themes allows for long titles.

For example, you might have all your latest posts in a Latest Posts list in a sidebar or something.

Pages are often different. Many blog designs use navigation buttons or something similar for pages. If you give your page a long title, it's too much text for button. So, you shorten the title, and now the text fits, but the title isn't long enough to be helpful for the SEs. Ideally you want a nice keyword-rich title for the main heading of the page.

There are plugins that allow you to have long titles but shot references for posts and pages, but I dislike having too many plugins. The code is real simple to do it yourself.

The method I describe below allows you to set a short title for the page, and specify a "long title" that is used for the first main heading on the page. (Remember you can also change the page permalink text, which should also be filled with some nice keywords.

After creating the page, and entering whatever short title you need to match the design requirements of your theme, add a new custom field by going to the Custom Fields box and clicking the Enter New link. Name the new field

long_title

and in the box to the right type the text you wish to display as the title in the main page heading. For example, the regular title of the page may be 'Weekend Plans' but the full long title could be 'Why I'll Be Hauling Stones Around My Yard This Saturday.'

Then, with your favorite text editor, find the php file for pages in your theme; it's usually called page.php. Make a copy for safe-keeping. For the main page heading there should be something like:

<h1><?php the_title();</h1>

and replace that with

<h1><?php echo(get_post_meta($post->ID, 'long_title', true)); ?></h1>

(I typed the above from memory, but I think it's right.)

Save the file as text and upload (ASCII transfer) to your theme's folder.


NOTE: If you've not done this sort of thing before with your WordPress themes it's probably not a good idea to start now. I understand S4E offers customizing consulting at $250 an hour, OR a dozen piccys of bouncing boobies.

You can apply the same general idea to putting custom text anywhere in your blog. Just create a field for it, and provide content - text, JavaScript, i-f-r-a-m-e code, ad banner, whatever. Use the ?php echo... line to place the content of the field where you want it. Replace 'long_title' with the specific name of the field.
 
 
 
 
Administrator
Tigger's Avatar

Reply With Quote
Blog Entries: 11
Send a message via ICQ to Tigger
 
Join Date: Mar 2009
Location: Spain
Posts: 12,412
12-05-2009, 12:54 AM
 
great tip VG and yes I've had the pain of having edit page names down to make them fit within the blog, so cheers
 
 
 
 
Adult Webmaster
jello's Avatar

Reply With Quote
 
Join Date: Mar 2009
Location: Brazil
Posts: 1,623
12-05-2009, 05:10 AM
 
Nice one VG
 
 
 
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 07:17 PM.
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2 Ad Management plugin by RedTyger