Page builders have made it easier for you to work with WordPress custom fields. Most page builders, including Brizy, come with a feature that allows you to display the custom fields’ data. The feature is especially great if you understand how custom fields work yet have no coding skills to create custom fields or display the custom fields’ data. Brizy itself supports popular custom field plugins like ACF, Pods, Meta Box, and Toolset. You can read our previous article to learn how to add custom fields in Brizy.
When attempting to display the data of the custom fields in Brizy, you might experience an issue whereby the data doesn’t show up as you expected. Don’t get mad. It’s not Brizy’s fault. We will explain why the error can happen.
In most page builders, including Brizy, the data of custom fields can only be displayed on the post type associated with the custom fields. For instance, custom fields’ data of the default post type (blog posts) can only be displayed on the blog posts as well. In this context, you need to create a custom template for the default post type to be able to display the custom fields’ data. You can’t display custom fields’ data on a regular page (non templates).
How to Display Custom Fields’ Data in Brizy (the Right Way)
As mentioned above, you can only display the custom fields’ data on the post type where the custom fields belong to. If you want to display the custom fields’ data of the default post type, for instance, you need to create a custom single post template and assign it to the default post type. For more detailed instructions on how to create a custom single post template in Brizy, you can refer to this post. In this post, we will go straight to adding the custom fields.
On the Brizy editor, drag the Text element and place it anywhere to your liking. Once the Text element is added, highlight the default text (or delete it). Press the hash key (#) on your keyboard to show the list of dynamic content. You can find the custom fields at the top section of the list. Simply select one you want to add.
You can then style up the custom field text just like when you are customizing the regular text.
A little note, Brizy doesn’t display the custom field’s’ data on the editor. Instead, it only displays the custom field name/label. The custom fields’ data is only displayed on the front-end so you can preview/publish your template to see the custom fields’ data.