Say "Hello!"

  • This field is for validation purposes and should be left unchanged.

Advanced Custom Fields – Using field group ID

Web Hosting at Bluehost Affiliate Disclosure

*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 } } } } ?-->

Back to Snippets Follow me on GitHub

Ashley Cameron logo
Blog