Developers

Gust takes a developer first approach to WordPress themes and as you nosey through the code, you'll see that almost everything passes through a filter allowing you to update it.

Working with templates

The Gust page builder is intended to be used for things like landing pages, content pages, etc. For templated pages such as posts, pages, products, etc it's likely that you'll want to touch the codebase directly and code these with PHP. There are a few things you'll need to be aware of to get the most out of Gust when taking this approach.

Developer mode

Turning on Developer Mode in the settings will load the development bundle of Tailwind CSS on the front-end. You don't want to do this in production! This is because the development bundle of Tailwind CSS is huge as it includes all the different class names. But it's perfect for development. So switch this on while you're building and don't forget to turn it off again when you're done.

Compiling stylesheets

If you use the Gust page builder, Gust will automatically keep track of the class names used on that page. When you save, it'll figure out whether it needs to re-build and if it does, will generate a new production CSS file.

When you're working with PHP files however, it's a little more tricky. Gust will scan the following templates in the theme or child theme and do its best to extract CSS class names:

  • 404.php
  • archive.php
  • attachment.php
  • author.php
  • category.php
  • comments.php
  • date.php
  • embed.php
  • footer.php
  • frontpage.php
  • header.php
  • home.php
  • index.php
  • page.php
  • paged.php
  • privacypolicy.php
  • search.php
  • searchform.php
  • sidebar.php
  • single.php
  • singular.php
  • tag.php
  • taxonomy.php

If you want Gust to watch out for any other templates you might be using, you can add them through the gust_safelist_templates filter. These should be relative to your theme directory as Gust will use locate_template under the hood to find them. If you have any other files that you want Gust to watch, pass them in using the gust_safelist_files filter, with the full path to the file.

You will need to trigger a manual rebuild of the stylesheet if you change any templates. To do that go to the Gust settings from the dashboard and click "Rebuild CSS". It may take a little while as it needs to update both the production and the development builds of your stylesheet.

Overriding the safe list

If the above still isn't quite enough, you can override the safe list that Gust sends to Purge CSS by using the gust_safelist filter.