Template support
A few templates, such as the cart, checkout and review sections, show figures that Bricks can't work out on its own: “You are saving…”, the discount percentage on a product and the rating bars. A small piece of code called Template support works them out.
If you use the Fancy Bricks plugin
You don't need to do anything. Template support comes inside the plugin from version 1.6.0.
If you don't use the plugin
Copy the code from your account and paste it in your site once. Go to My account: under How you copy you'll find Template support. Click Copy code, then paste it in one of these two places.
With Code Snippets (easiest)
- In WordPress, go to Plugins › Add New, search for Code Snippets and install and activate it.
- Go to Snippets › Add New. Give it a title, for example Fancy Bricks template support.
- Paste the code in the code box. Leave the type as PHP and Run snippet everywhere.
- Click Save Changes and Activate.
In your child theme's functions.php
Paste it in the child theme, never in the Bricks theme itself: Bricks updates replace its files and would erase the code.
- Check that your site uses a child theme: in Appearance › Themes, the active theme should be Bricks Child (or another child theme). If the active one is Bricks, use Code Snippets instead, or install the Bricks child theme first from your Bricks account.
- Go to Appearance › Theme File Editor. If you don't see it, your host or a security plugin turned it off: use Code Snippets, or your host's file manager (see below).
- In Select theme to edit, choose Bricks Child and click Select. Then open Theme Functions (functions.php) in the file list on the right.
- Copy what's in the file and keep it somewhere safe, so you can put it back if something goes wrong.
- Go to the very end of the file, add an empty line and paste the code there:
- not before the first line (
<?php); - if the file ends with
?>, paste the code before that line.
- not before the first line (
- Click Update File. If WordPress shows an error, the file isn't saved: check that you pasted the whole code in the right place and try again.
With your host's file manager or FTP: open wp-content/themes/bricks-child/functions.php (the folder of
your child theme), and follow steps 4 to 6.
A few things to keep in mind:
- It's safe to paste twice, and it works next to the plugin: if both are there, nothing breaks.
- The code has no opening
<?phptag on purpose. The file you paste it in already has one, and a second one would break your site.
What happens without it
Nothing breaks. The templates still work, and the parts that need the code are simply hidden: the “You are saving…” line, the discount percentage and the rating bars. Each template that uses it says so in its builder note and links to this page.