A Cozmoslabs Product
Documentation / Custom Fields Creator / How to / Display a Custom Field

Display a Custom Field

To display Custom Fields values we use the function the_cfc_field().

For a Single Meta Box

In The Loop:

/* 
 *Let's say we want to display the field Last Name (the slug will be last-name) from a Single Meta Box  
 */

Name: 

Outside The Loop:

/*
 * Let's say we want to display the field Description (the slug will be description) 
 * From a Single Meta Box, from the post with id 46 
 */

Description: 

For a Repeater Meta Box

Besides the function the_cfc_field() for a repeater we also need get_cfc_meta() function.

In The Loop:

/* 
 * Let's say we want to display all the fields Last Name (the slug will be last-name) from a Repeater Meta Box  
 */

 $value ){ ?>
    Name: 

Outside The Loop:

/*
 * Let's say we want to display all the fields Description (the slug will be description) 
 * From a Repeater Meta Box, from the post with id 46 
 */

 $value ){ ?>
    Description: 

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket