ACF: get_field() returning false [closed]

You need to pass in the ID of the post you’re trying to get the field from: Eg get_field(‘display_featured_image’, $post_id). In a loop you could do get_field(‘display_featured_image’, get_the_id()); ACF Stores field data in wp’s meta_fields, so you could even use WP’s built in meta handler to pull the data yourself Eg: get_post_meta( $post_id, ‘acf_field_name’, true); … Read more

Advanced Custom Fields select field : How to echo the label, not the value? [closed]

The get_field_object() function requires the field KEY not the field NAME. See docs: http://www.advancedcustomfields.com/resources/functions/get_field_object/ So it should looks something like this… $field = get_field_object(‘field_53d27f5599979’); $value = get_field(‘field_myfield’); $label = $field[‘choices’][ $value ]; You can find the field key by clicking on “Screen Options” > “Show Field Key” and it should appear next to the field … Read more

ACF – get fields from group

Thank you so much for your post, I spent half day to figure out how to get field names by their group. If you have field names, you can easily get their values: get_field($field[‘name’]); EXAMPLE HOW TO GET IMAGES FOR SLIDER <?php //or insert the ID of your fields Group. $groupID=’116′; $custom_field_keys = get_post_custom_keys($groupID); foreach … Read more

Filtering multiple custom fields with WP REST API 2

This solution works with get_items() in /lib/endpoints/class-wp-rest-posts-controller.php of the v2 WP Rest API. First, you’ll want to construct the GET arguments like you would for a new WP_Query(). The easiest way to do this is with http_build_query(). $args = array ( ‘filter’ => array ( ‘meta_query’ => array ( ‘relation’ => ‘AND’, array ( ‘key’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)