Support » Fixing WordPress » All pages has the same title in paged archive…

  • If precisely, all pages has the same tag <title> in paged archive or category, i wish to add “page2” in <title> for archived page2, “page3” in <title> for page3 … etc

    What tag in i should use in <title>?
    Or it not so simple?

Viewing 3 replies - 1 through 3 (of 3 total)
  • From the default theme, the sidebar uses:
    if (isset($_GET['paged']) && !empty($_GET['paged']))
    to determine if it’s a paged archive.

    So just edit your theme’s header.php and use
    <title>The normal title stuff -
    <?php if (isset($_GET['paged']) && !empty($_GET['paged'])) { echo ('page'.$_GET['paged']) } ?>
    </title>

    would give you the page number in the title.

    NOTE: I have no idea what the security implications of echoing out $_GET like this would be. But I do recall that you should probably encode the $_GET[‘paged’] output or something along those lines.

    Many thanks, it works!
    But … small addition is necessary in your code – “;”
    🙂

    $_GET[‘paged’] do not working in WP 2.0
    what’s happened?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘All pages has the same title in paged archive…’ is closed to new replies.