Where to put code samples
On this site, you'll see lots of code samples that allow you to modify GravityView functionality. We recommend adding the code to your theme's functions.php file.
You can edit your theme's functions.php file by:
- Hovering over the Appearance menu
- Clicking the "Editor" link in the flyout menu that appears
- Clicking on the link named Theme Functions (functions.php)
- Modifying the code in the editor
If you're not comfortable adding the code to your live site, don't.
We recommend using Codeable.io to help you install customizations; that way, you know it's being done properly.
We do encourage you to learn how to add code yourself, but learning code always (yes, always!) eventually leads to breaking a site. Just know that going in, and you'll be fine :-)
If you're comfortable adding the code yourself:
- The code should go after the
<?phpat the start of the file
- The code should go before
?>at the end of the file (if it exists)
- Do not nest
<?phptags. If you copy/paste code, don't have duplicate opening
<?phptags like this:
<?php existing code <?php // <--- This is a duplicate tag. new code you pasted ?>
- Again, if you're not comfortable editing your theme's functions.php file, have someone help you!