Support

Account

Home Forums General Issues Can't get Field Label to display in my theme

Helping

Can't get Field Label to display in my theme

  • I can’t get my Advanced Custom Field Label to display in my theme.

    I want to achieve something like this

    
    $field_name = "doc_author"; $field = get_field_object($field_name);
    
    echo $field['label'] . ': ' . $field['value'];
    

    I can display the field value like this

    
    $buffy .= get_post_meta($this->post->ID, "document_author", true);
    

    How can i display both the label and the value?

  • Hi @nsisongeffiong

    It looks like you are using the wrong field_name in the get_field_object code.

    Looking at your second script, the field name should be “document_author”, not “doc_author”

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Can't get Field Label to display in my theme’ is closed to new replies.