Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I bought a few themes that by default don't have blog posts on home page as normal WordPress themes such as Twenty Eleven has. I had to create a page of Blog template and then use it for home page in Settings -> Reading.

It works, except for the pagination pages aren't redirecting properly AND page number isn't shown in the page title.

For example, both of these pages are accessible with or without trailing slash:

And they NEVER redirect to the canonical one as normal WordPress blog pagination pages should. And the page number isn't being displayed in <title></title>, it's just "Page | Shanghai Web Hosting". Seems $paged or $page variable isn't assigned a value or something.

It's all the same problems with another site that I used a Blog template page for the home page:

Are both accessible and NEVER redirects. The page number is neither shown in the title tag.

Any idea why this is happening and how I can fix this? Would it be a theme issue or is it a WordPress bug?

Thanks!

share|improve this question
    
possible duplicate of Pagination not working with custom loop –  Chip Bennett Feb 4 '13 at 18:46
add comment

1 Answer

try add trailingslash for paged

add_filter('user_trailingslashit', 'wpse_paged_trailingslash',10,2);
function wpse_paged_trailingslash($url,$type){
    if ($type === 'paged')
    {
        if (substr(get_option('permalink_structure'), -1) !='/')
        return trailingslashit($url);
    } else {
        return $url;
    }
}
share|improve this answer
    
Hi, thanks for the tip. But what does this do? Is it a WordPress bug? –  kavoir.com Jun 17 '12 at 9:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.