Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good afternoon

Advanced Custom Fields – Using field group ID

This post was last updated: Nov 7, 2022
SnippetsWordPress

About a 1 minute read

"The art of living… is neither careless drifting on the one hand nor fearful clinging to the past on the other. It consists in being sensitive to each moment, in regarding it as utterly new and unique, in having the mind open and wholly receptive."

Alan Watts

*Update* This function has been deprecated since v3.3.4, please use have_rows() instead.


1
2
3
4
<!--?php $groupId = 102; //ID of field group. Get this from the Edit Field Group page url (post=#) if (class_exists('Acf')) { $fields = new Acf(); if (method_exists( $fields, 'get_acf_fields') ) { foreach ($specs -&gt; get_acf_fields($groupId) as $field) { $value = get_field($field['name']); ?-->
            <!--?php if ($value) { ?-->
                <img src="&lt;?php echo $value ?&gt;" alt="" />
            <!--?php } } } } ?-->