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:

  1. Hovering over the Appearance menu
  2. Clicking the "Editor" link in the flyout menu that appears
  3. Clicking on the link named Theme Functions (functions.php)
  4. 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:

  1. The code should go after the <?php at the start of the file
  2. The code should go before ?> at the end of the file (if it exists)
  3. Do not nest <?php tags. If you copy/paste code, don't have duplicate opening <?php tags like this:
    existing code
    <?php // <--- This is a duplicate tag.
    new code you pasted
  4. Again, if you're not comfortable editing your theme's functions.php file, have someone help you!
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.