22 Apr

- Tagged in "How To" / Page 2 -

Register fields via PHP

This article will discuss how to register fields and field groups via the functions.php file. There are many benefits to using PHP to register fields, the main of which is customization and distribution. The ability to define fields within the theme’s files allows developers to avoid any data loss when working across multiple environments (dev/staging/live). […]

Continue Reading

13 Mar

Debug, diagnose and solve

When customizing your theme with ACF functionality, you may experience some issues. These issues may resemble a blank page, a broken page, a value not being loaded or a visible error report. Although frustrating at first, these issues are i... Continue Reading

10 Sep

Hiding empty fields

Overview It is a common task to hide empty field values from your template. This can be achieved by using conditional statements to check the value before rending it. The basics to conditional a statement is to use an if statement. You can ... Continue Reading

20 Aug

Order posts by custom fields

This article will demonstrate how to retrieve and sort an array of post objects from the database using native WP functions. There are many ways to query posts in WP, however, this article will make use of the common get_posts function, WP_... Continue Reading

23 Apr

Get values from another post

All the template functions (get_field, the_field, etc) can be used to load values from another post, however, a second parameter is required to target the post. Each post has a unique ID which can be found in the URL when editing, or found ... Continue Reading

19 Feb

Sort a Repeater Field

This article will cover how to sort a repeater field based on it’s sub field values using a function called array_multisort(). Getting started The following examples assume a repeater field exists containing 2 sub field; ID (number fi... Continue Reading

19 Feb

Register multiple options pages

Multiple options pages can be registered by making use of the acf_add_options_page() and acf_add_options_sub_page() functions. Both functions can be used within the theme functions.php file. Once registered, each options page will appear wi... Continue Reading

19 Feb

Disable Custom Fields Editing on a Live Site

Overview When delivering a website to a client, it may be beneficial to hide the “ACF” menu item. This prevents your client from changing or deleting fields and keeps the site running smoothly. This doc details three methods for hiding ... Continue Reading

19 Feb

Create a front end form

This article will cover how to create a form on the front end of your website to add or edit content. Two functions are available to create a working form in a template file. Name Description acf_form_head() This function is placed at the t... Continue Reading