All pages has the same title in paged archive... (4 posts)

  1. iliton
    Posted 10 years ago #

    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?

  2. alrescha
    Posted 10 years ago #

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

    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.

  3. iliton
    Posted 10 years ago #

    Many thanks, it works!
    But ... small addition is necessary in your code - ";"

  4. iliton
    Posted 10 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic