Custom Code

  • All custom code can contain HTML or Twig code and has access to route variables.
  • Head code will be added before the </head> tag.
  • Foot code will be added before the </body>.
  • There are three ways to add custom code to your blog.
    1. Blog
    2. Post
    3. Tag
  • Custom code is added in the Blog -> Post -> Tag order.

1. Blog

You can add custom code to the whole blog. This way, the custom code will be added to all templates in your blog. This is useful for adding services like analytics.

Console → Settings → Custom Code

2. Post

You can also add custom code a specific post only in Post Settings. The custom code will then only be added to that post.

Console → Post → Advanced → Head/Foot Code

3. Tag

You can also define custom code for a tag. Then, this custom code will be added to the posts that has this tag.

Console → Settings → Tags → Edit Tag → Custom Code

For example, posts that have SVG animations will need an additional Javascript library to play SVG animations. You can assign a svg tag to those posts and link to the Javascript library in the custom code of the svg tag.

In addition to these methods, you can also edit the theme directly.