the_sub_field

Get_sub_field().

Description

the_sub_field( (string) $field_name ); 

This function is the same as echo get_sub_field

Parameters (1)

0. $field_name (string)
The field name.

Usage

  1. if ( !function_exists( 'the_sub_field' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'advanced-custom-fields/core/api.php'; 
  3.  
  4. // The field name. 
  5. $field_name = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = the_sub_field($field_name); 
  9.  

Defined (1)

The function is defined in the following location(s).

/core/api.php  
  1. function the_sub_field($field_name) 
  2. $value = get_sub_field($field_name); 
  3.  
  4. if(is_array($value)) 
  5. $value = implode(', ', $value); 
  6.  
  7. echo $value;