Skip to content
This repository was archived by the owner on Jun 13, 2019. It is now read-only.

Custom Fields

Michael Xian edited this page Nov 4, 2018 · 8 revisions

Custom Fields Used

Paragraph

Paragraph (ACF)

This ACF has 2 fields. The fields are as follows:

  • Enable Paragraph (True/False)
    • Whether or not to display this paragraph
  • Paragraph (Text)
    • The text in the body of the paragraph

To display this in a template, insert the following code block

<?php
  $paraEnabled = get_field("paragraph-enabled");
  if ($paraEnabled) { // Set up varialbes if the paragraph was enabled
    $para = get_field("paragraph");
    if ($para) { // If there is something in paragraph, display it
      echo "<p>${para}</p>";
    }
  }
 ?>

Clone this wiki locally