Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#14779 closed defect (bug) (worksforme)

File paged.php in theme seems will never be loaded

Reported by: nazieb Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Template Keywords: has-patch
Focuses: Cc:


There is a function 'get_paged_template' which will load paged.php in the theme if 'is_paged' conditional tag is true.

But when I create paged.php for my paged posts, it seems that the file is not loaded. The blog always load index.php instead.

My guess is in WP Query class, when a paged posts is called, the $is_home variable is still set to be true. So when the template loader executed, Wordpress will always load index.php

Attachments (2)

query.diff (875 bytes) - added by nazieb 8 years ago.
deprecate-get_paged_template.diff (1.8 KB) - added by scribu 8 years ago.

Download all attachments as: .zip

Change History (7)

8 years ago

#1 @nazieb
8 years ago

  • Keywords has-patch added

#2 @nazieb
8 years ago

  • Keywords theme removed

#3 @scribu
8 years ago

is_home should be set regardless of is_paged.

The paged.php template is a bad idea to start with because it doesn't fit in the template hierarchy at all. You'll see it's not even mentioned. I think we should deprecate it.

You should just use the is_paged() conditional tag inside a single template file.

#4 @nacin
8 years ago

get_paged_template() only works for index.php, which to me makes sense. Sometimes the index page may have a drastically different design than page 2 of the stream of content. But if you're trying to use paged.php for paginating, say, any archive such as dates, category, tag, etc... it won't work. In that case you need to use is_paged().

Suggesting we close as worksforme.

#5 @nacin
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.