Plugin Directory

Optimal Title

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'); } ?>

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus

No data

Average Rating

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