Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

acf the_field get a value from different objects

$post_id = false;           // current post
$post_id = 123;             // post ID = 123
$post_id = "user_123";      // user ID = 123
$post_id = "term_123";      // term ID = 123
$post_id = "category_123";  // same as above
$post_id = "option";        // options page
$post_id = "options";       // same as above

the_field( 'my_field', $post_id );
Source by www.advancedcustomfields.com #
 
PREVIOUS NEXT
Tagged: #acf #objects
ADD COMMENT
Topic
Name
4+5 =