Advanced Custom Fields is a WordPress plugin that allows you to add extra content fields to your website. These customizable input boxes are more commonly referred to as custom fields, and they can help builders create websites faster with less bloat.
In this guide, you’ll learn how to:
- Install the ACF plugin
- Create new fields
- Create field content
- Display fields in your theme
ACF offers a custom field that can easily be added to any page, post, or custom content type. This makes it easy for you to create a Hero Image and show it when editing your homepage!
The ACF plugin does not come pre-installed with WordPress, so you will need to install our plugin before using its excellent features. Luckily for you, WordPress makes this a straightforward process.
If you are familiar with WordPress, log in to your site and search/install the Advanced Custom Fields plugin from the plugins page.
For detailed instruction, please read the advanced custom fields step-by-step instruction guide.
Creating new custom fields is a straightforward process and can be done with just a few clicks using the field builder. You can complete as many fields as you like, each with an individual name, type, and settings. Each Field is added to a group that allows you to organize your fields accordingly.
Field groups are used to organize fields; each field group contains a title, fields, location rules, and visual settings.
Each Field uses unique field types and values to differentiate the fields. You can also select the input types (text, images, URLs, etc.)
After creating your field group, you select the location of where you want these custom fields to show up in the backend of WordPress.
You can enter your content and update the post after selecting the custom fields to show up; you can enter your content and edit the post.
Fields are not just available for posts and pages. You can display your custom fields on custom templates, author pages, custom post types, category, and tag pages.
To get a better idea of all of your options, please check out the available field types.
Adding the PHP
To display your content on the website, you will need to add PHP scripts to the areas where you want the content to appear. e.g.,
These PHP functions (alongside many others) provide a developer-friendly way to customize your WordPress theme without spending hours of learning.
Here is some example code to see how the API works!
You will need to add the appropriate PHP snippets to the WordPress theme in areas where you’d like them to show up.