Layouts

WordPress Details

TemplateX keeps layouts WordPress-friendly when they compile.

WordPress Hooks#

Layouts do not need to include these calls by hand:

  • language_attributes()
  • wp_head()
  • body_class()
  • wp_body_open()
  • wp_footer()

TemplateX adds the needed WordPress pieces to the compiled PHP.

Local Assets#

Local asset links in a layout are handled by TemplateX:

phpresources/views/layouts/default.php
<head>  <link rel="stylesheet" href="main.css"></head><body>  {{ slot }}  <script src="main.js"></script></body>

When the theme is built or published, TemplateX points those links at the generated theme assets.