acf get field

Solutions on MaxInterview for acf get field by the best coders in the world

showing results for - "acf get field"
Eleonora
25 Apr 2016
1$content = get_field('content', $post_id);
Bryan
25 Sep 2018
1$value = get_field( "text_field" );
2
3if( $value ) {
4    echo $value;
5} else {
6    echo 'empty';
7}
Maria
11 Sep 2019
1get_field($selector, [$post_id], [$format_value]);
2/*
3$selector (string) (Required) The field name or field key.
4$post_id (mixed) (Optional) The post ID where the value is saved. Defaults to the current post.
5$format_value (bool) (Optional) Whether to apply formatting logic. Defaults to true.
6*/
7// Get a value from the current post
8$value = get_field( "text_field" );
9// Get a value from a specific post
10$value = get_field( "field_name", $post_id );
Niclas
17 Feb 2020
1<?php echo get_field( "text_field" );?>