Custom HTML

Every theme offers few places where user can inject custom HTML code. By default there are three places available: head, body and footer

  • @headCustomCode - custom code added in the end of head section
  • @bodyCustomCode - custom code added at the beginning of the body section (after opening body tag).
  • @commentsCustomCode - custom code added in place of comments area (if enabled under site/post settings)
  • @footerCustomCode - custom code added to the footer section (before closing body tag)
  • @footerAmpCustomCode - custom code added to the footer section in AMP template (before closing body tag)
  • @headAmpCustomCode - custom code added in the end of head section in AMP template

Themes can also define their own areas through the @customHTML variable.

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide