Ticket #4407 (closed enhancement: fixed)

Opened 1 year ago

Last modified 5 months ago

Integrate Optimal Title

Reported by: cpoteet Assigned to: ryan
Priority: normal Milestone: 2.5
Component: Optimization Version:
Severity: normal Keywords: has-patch 2nd-opinion
Cc: cpoteet, docwhat, ryan

Description

One of the SEO horrors of the current WP scheme is the title template tag. The Optimal Title plugin does however circumvent this. Can we use such a methodology to create a new template tag or replace the old one?

http://elasticdog.com/2004/09/optimal-title/

Attachments

separator-location.diff (0.9 kB) - added by cpoteet on 10/05/07 23:26:12.

Change History

06/05/07 01:54:25 changed by torbens

+1

06/05/07 03:12:37 changed by rob1n

  • owner changed from anonymous to rob1n.
  • milestone changed from 2.4 (future) to 2.3 (trunk).

What I'm thinking is basically another argument for wp_title (right now we've got separator and display) which is an argument string that has order and so on.

Also, it would be nice if, on a 404, the text could be Not Found, or something more useful.

06/05/07 15:22:56 changed by Otto42

Optimal title could be replaced by this code:

function optimal_title_filter($title, $sep) {
	$sections = explode(" $sep ", $title);
	array_push($sections, array_shift($sections));
	$optimal_title = implode(" $sep ", $sections);
	return $optimal_title;
}
add_filter('wp_title','optimal_title_filter',10,2);

This filter would make the normal wp_title() call function in the same way as optimal title 3.0 does. Just add the filter when needed.

06/05/07 17:30:31 changed by cpoteet

@Otto: So are you thinking about including it in the trunk?

06/06/07 14:02:09 changed by Otto42

@cpoteet: Not my call. I was just offering up code to use if the devs decide to put it in there. :)

06/09/07 21:23:49 changed by cpoteet

  • owner changed from rob1n to cpoteet.

Robin - Going to add this.

06/09/07 21:28:15 changed by cpoteet

  • status changed from new to assigned.

09/05/07 20:04:35 changed by foolswisdom

  • milestone changed from 2.3 to 2.4 (next).

10/05/07 23:26:12 changed by cpoteet

  • attachment separator-location.diff added.

10/05/07 23:27:12 changed by cpoteet

  • keywords changed from 2nd-opinion to has-patch.

I decided instead of integration the explode/implode in the plugin to add a parameter as rob1n suggested.

Basically, it adds a parameter onto wp_title that determines the location of the separator. Acceptable values are 'right' or 'left' but defaults to it being on the left as it behaves now. The if/else check only looks at whether the separator is placed on the right and moves it.

What do you think?

10/16/07 13:26:05 changed by docwhat

  • cc changed from cpoteet to cpoteet, docwhat.

10/18/07 01:23:39 changed by cpoteet

  • keywords changed from has-patch to has-patch 2nd-opinion.

(follow-up: ↓ 13 ) 10/19/07 04:04:09 changed by ryan

Let's just change the default.

(in reply to: ↑ 12 ) 10/19/07 04:07:49 changed by cpoteet

  • cc changed from cpoteet, docwhat to cpoteet, docwhat, ryan.

Replying to ryan:

Let's just change the default.

So, should we scrap the parameter and just switch the ordering? Let me know Ryan, and I'll make the change.

10/19/07 18:57:52 changed by ryan

Yes, scrap the parameter and switch the ordering. It's a better default.

(follow-up: ↓ 16 ) 10/19/07 19:07:02 changed by ryan

Actually, after looking at how various themes use wp_title(), we probably can't change the default. So, I think we can go with your current patch.

(in reply to: ↑ 15 ) 10/19/07 20:03:58 changed by cpoteet

Replying to ryan:

Actually, after looking at how various themes use wp_title(), we probably can't change the default. So, I think we can go with your current patch.

Ya, that's why I figured to keep the default as the legacy position. Maybe in a future release we could switch it indefinitely.

Thanks Ryan!

12/20/07 05:40:27 changed by ryan

  • owner changed from cpoteet to ryan.
  • status changed from assigned to new.

01/02/08 20:45:17 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6538]) Add separator location arg to wp_title. Props cpoteet. fixes #4407

01/02/08 23:05:40 changed by drhallows

Nice! This will replace the use of plugin optimal title Thanks you so much!