WordPress.org

Ready to get started?Download WordPress

Forums

wp_title problem with pagination (4 posts)

  1. bnvt
    Member
    Posted 3 years ago #

    I'm having some problems with the title that wp_title function generates for my site.
    When browsing category pages, the function outputs the category name as the title, as it should. Except when pagination is working: if there is more than one page, wp_title will return "page not found" as the title for the last page in the pagination. The category name displays fine for the rest.

    I'm using the filter for wp_title found in the TwentyTen theme which adds some other stuff to the title, but that's not causing the problem, I tried removing it.

    I checked the wp_title function in general-template.php, and the "page not found" should be retuned in a "if(is_404())" condition only, which obviously is not the case.

    Any help would be much appreciated.
    The site url is http://www.bnvt.es
    You can see the problem in action here: http://www.bnvt.es/?cat=9&paged=2

    Thanks a lot!

  2. themattyg
    Member
    Posted 3 years ago #

    I'm having the same problem. Pagination works, except when you go to page 2 or more, it loses the Category name and displays "Page not Found - [site title]" with my setup.

    Help!

  3. themattyg
    Member
    Posted 3 years ago #

    Seems to go deeper than that. When accessing everything after the first page in a category, it doesn't use the category template anymore.

    Any tips would be greatly appreciated!

  4. keesiemeijer
    moderator
    Posted 3 years ago #

    Try putting this before the loop in your theme's archive.php or category.php:

    <?php
    if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
    elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
    else { $paged = 1; }
    global $query_string;
    query_posts( $query_string . '&paged='.$paged );
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic