Home › Forums › Add-ons › Flexible Content Field › Unique ID, count flexible field? › Reply To: Unique ID, count flexible field?
Flexible content itself does not contain a unique ID. However, you can easily append one when outputting the flexible content. For example, if outputting your slider wrap it in a container such as:
<div id="slider-container-<?php echo $counter++; ?>" class="slider-wrapper"> Container content... </div>
$counter before your loop and set it to 1 or 0.
If you’re using jQuery you can also set the context for the selector so it does not apply it document-wide: http://api.jquery.com/jquery/#jQuery1
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.