[wp-trac] [WordPress Trac] #59422: Custom Post Type name with hyphen does not with custom single post template

WordPress Trac noreply at wordpress.org
Thu Sep 21 08:19:40 UTC 2023


#59422: Custom Post Type name with hyphen does not with custom single post template
--------------------------+-----------------------------
 Reporter:  htung         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  6.3.1
 Severity:  normal        |   Keywords:
  Focuses:  template      |
--------------------------+-----------------------------
 Hi,

 I have registered a new custom post type namely "annual-report". Then I
 try to create singe-annual-report.php in theme folder to call out single
 post detail page, however it seems not working.

 While single-$postname.php works perfectly when it comes to custom post
 type name with single word without hypen, such as "annualreport".

 May I know is there is any restriction of WP custom post type name and
 applied on theme file calling?

 Thank you.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59422>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list