WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#43563 new defect (bug)

Custom Page Template not working if page slug name is too short

Reported by: richardevcom Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.4
Component: Posts, Post Types Keywords: reporter-feedback
Focuses: template Cc:
PR Number:

Description

Hi.

I was trying to create Custom Page Template named "Darbi". I created page-darbi.php template file, added Template name: Darbi comment line and then assigned the tempalate in page editor, but after save nothing changed and page was returning index.php.

I was digging around and when I changed the page slug name to 6+ characters long it worked so my guess is that the issue is with page slug name length and custom page template functionality.

I haven't tested this on earlier versions but in stackoverflow.com there were similar issues with versions 4.7 and up.

Change History (5)

#1 follow-up: @mukesh27
20 months ago

  • Focuses administration removed

it's working fine even if i rename Page Template Name to single alphabet "D" try to install new WordPress then check.

#2 @SergeyBiryukov
20 months ago

  • Component changed from General to Posts, Post Types

#3 follow-up: @SergeyBiryukov
20 months ago

  • Keywords reporter-feedback added

Hi @richardevcom, welcome to WordPress Trac! Thanks for the report.

Does it still happen with all plugins disabled and a default theme (Twenty Seventeen) activated?

#4 in reply to: ↑ 1 @richardevcom
20 months ago

Replying to mukesh27:

it's working fine even if i rename Page Template Name to single alphabet "D" try to install new WordPress then check.

did you try both slug & template for ex. 5 characters long?

#5 in reply to: ↑ 3 @richardevcom
20 months ago

Replying to SergeyBiryukov:

Hi @richardevcom, welcome to WordPress Trac! Thanks for the report.

Does it still happen with all plugins disabled and a default theme (Twenty Seventeen) activated?

Yes. Disabled all the plugins. Haven't tried with Twenty Seventeen theme instead. I'll update you.

Last edited 20 months ago by richardevcom (previous) (diff)
Note: See TracTickets for help on using tickets.