advanced-custom-fields the_field()


Syntax

  • the_field($field_name, $post_id);

Parameters

ParamenterDetails
$field_namethe name of the field to be retrieved. eg “page_content” (required)
$post_idSpecific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc

Remarks

Use get_field() when assigning field values to variables, or when manipulating the returned content in your code. the_field() is the same as echo get_field($field_name);