If you return the icon selection as a URL and you’re wanting to spit out the full SVG code inline, you can use:
<?php echo file_get_contents('URL OF ICON HERE'); ?>
You’d be able to do this if you do an incrementing variable like:
<?php $i = 1; if( get_field('repeater') ): while( has_sub_field('repeater') ): ?>
<?php if ( $i == 1 ) { ?>
This is first list item
<?php } elseif ( $i == 2 ) { ?>
This is second list item
<?php } elseif ( $i == 3 ) { ?>
This is third list item
<?php } elseif ( $i == 4 ) { ?>
This is the fourth list item and so on...
<?php } ?>
<?php $i++; endwhile; endif; ?>
I wouldn’t duplicate the entire block of content that way but maybe like assign the image size to a variable and call it later or just do the $i conditional on the spot with the call to the image or similar. Hopefully that makes sense.
This doesn’t involve ACF but you could probably just leverage Gravity Forms admin only fields here. When adding a form field, under the Advanced section of that field’s settings you can add fields that are only visible in the admin.
There are add-ons that are geared towards similar functionality for the ACF image field, such as: https://wordpress.org/support/plugin/acf-image-crop-add-on/
Within the events repeater, all of your field names except the one that is working use dashes in their field key names vs. underscores. Underscores are the default structure so I would check to make sure your variables are calling correct field names and it shouldn’t be event_date, event_name, etc. vs. event-date, event-name like you have.
It’s not a bug. As John pointed out, it’s default behavior as of 5.6.0 (see link above) — so if you want the regular custom fields, as well, then you’ll need to utilize that filter above in your theme’s functions file.
With help from a friend was able to find a solution based on the change noted in this post: https://www.advancedcustomfields.com/blog/acf-pro-5-5-13-update/
However, despite what the post says, it seems that it actually isn’t set to false by default. I was able to get custom fields to return by adding:
add_filter('acf/settings/remove_wp_meta_box', '__return_false');
to my functions.php file within the theme.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.