Template Overrides

Elzo Forms loads templates through the template loader and supports customization through template-related filters.

Relevant filters and actions

  • elzo_forms/templates/theme_dir — customize the theme template directory name.
  • elzo_forms/templates/locate_template — override the located template path.
  • elzo_forms/templates/template_args — adjust arguments passed into a template.
  • elzo_forms/templates/before_template — run code before a template is loaded.
  • elzo_forms/templates/after_template — run code after a template is loaded.
add_filter('elzo_forms/templates/theme_dir', function () {
    return 'elzo-forms';
});

Use a child theme for overrides so updates do not remove your changes.