WordPress.org

Ready to get started?Download WordPress

Forums

Weird Title Glitch (3 posts)

  1. alanchrishughes
    Member
    Posted 2 years ago #

    It noticed this when creating conditional page titles, this is the current code that ultimately worked, but at first when I had the elseif for archives above the elseif for categories it would title all my category pages as archives for some reason. Strange.

    <title>
    <?php
    if ( is_single() ) { bloginfo('name'); echo ' - '; the_title();}
    elseif ( is_category() ) { bloginfo('name'); echo ' - Categories';}
    elseif ( is_page() ) { bloginfo('name'); echo ' - '; the_title();}
    elseif ( is_archive() ) { bloginfo('name'); echo ' - Archives';}
    else { bloginfo('name');}
    ?>
    </title>
  2. esmi
    Forum Moderator
    Posted 2 years ago #

    is_archive()
    When any type of Archive page is being displayed. Category, Tag, Author and Date based pages are all types of Archives.

    http://codex.wordpress.org/Conditional_Tags#Any_Archive_Page

  3. alanchrishughes
    Member
    Posted 2 years ago #

    So it is an intentional glitch?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.