Plugin Directory

Optimal Title

Optimal Title mirrors the function of wp_title() exactly, but moves the position of the 'separator' to after the title rather than before.

Download Version 3.0

What options can be passed to optimal_title()?

Optimal Title functions in the exact same way as wp_title(), and thus you may specify the following options:

<?php optimal_title('separator', display); ?>
  • separator - (string) Text to display between portions of the title (i.e. the separator), such as the archive elements of year and month. Defaults to '&raquo;' (»).
  • display - (boolean) Display the page title (TRUE), or return it for use in PHP (FALSE). Defaults to TRUE.

What specifically needs to be changed in the header.php file?

The most simple answer is to remove everything between the HTML <title></title> tags and then put the following code in its place:

<?php optimal_title(); ?> <?php bloginfo('name'); ?>

If you want a slightly safer version that won't break if you do not have the plugin activated or installed, then try something like this in between the HTML <title></title> tags:

<?php
if ( function_exists('optimal_title') ) {
    optimal_title(); bloginfo('name');
} else {
    bloginfo('name'); wp_title(); }
?>
<?php if ( is_home() ) { ?> | <?php bloginfo('description'); } ?>

Requires: 1.2 or higher
Compatible up to: 2.3.3
Last Updated: 2007-4-12 Downloads: 38,911

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(10 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1