[wp-trac] [WordPress Trac] #56762: PHP file being ignored in block theme hierarchy

WordPress Trac noreply at wordpress.org
Thu Oct 20 11:45:55 UTC 2022


#56762: PHP file being ignored in block theme hierarchy
---------------------------+------------------------------
 Reporter:  ryanpluckrose  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Themes         |     Version:  6.0.2
 Severity:  major          |  Resolution:
 Keywords:  needs-patch    |     Focuses:  template
---------------------------+------------------------------

Comment (by ryanpluckrose):

 Ah yes it is!

 Mixed with that post and the explainer above hopefully you can see what
 I'm trying to achieve.

 I'll have a read of that handbook link, thanks!

 Replying to [comment:8 psykro]:
 > @ryanpluckrose hey there. Could I confirm something, does this ticket
 related to your question about adding a post meta field to a template?
 >
 > https://wordpress.org/support/topic/how-to-add-post_meta-to-a-block-
 theme-html-file/#post-16075706
 >
 > As @poena has pointed out, PHP files will not work inside the templates
 or parts directories of a block theme. If you need PHP functionality, you
 might have to add that to a pattern, which is included in the template or
 template part.
 >
 > This theme developer handbook explains how to create and use patterns
 >
 > https://developer.wordpress.org/themes/advanced-topics/block-patterns/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56762#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list