Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Senior Member bamme's Avatar
    Join Date
    Aug 2009
    Posts
    319
    Member #
    19662
    Liked
    1 times
    Hi all

    Im beginning to study WP theme dev. I'm reading this book, which tells me that a good way to add the title tag to your header.php is this:

    PHP Code:
    <title>
    <?php if (function_exists('is_tag') && is_tag()) {
    single_tag_title('Tag Archive for &quot;'); echo '&quot; - ';
    } elseif (
    is_archive()) {
    wp_title(''); echo ' Archive - ';
    } elseif (
    is_search()) {
    echo 
    'Search for &quot;'.wp_specialchars($s).'&quot; - ';
    } elseif (!(
    is_404()) && (is_single()) || (is_page())) {
    wp_title(''); echo ' - ';
    } elseif (
    is_404()) {
    echo 
    'Not Found - ';
    }
    if (
    is_home()) {
    bloginfo('name'); echo ' - 'bloginfo('description');
    } else {
    bloginfo('name');
    }
    if (
    $paged 1) {
    echo 
    ' - page '$paged;
    ?>
    </title>
    This is referenced here:

    But as I'm a newb with not much experience of PHP, plus an error was pointed out in the comments below that article, im unsure whether this still works for wordpress 3.0 and up or if there's a quicker way of making good titles like this?

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:57 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com