Support

Account

Home Forums ACF PRO Getting a unique ID/slug for Flexible Content modules

Unread

Getting a unique ID/slug for Flexible Content modules

  • Hi, I have been searching and trying for a solution to this for a while and whilst I’ve come close, I can’t quite get there.

    I’m trying to add a unique id to each flexible layout module. I know this can be done using an incremental counter but I need something permanent that won’t change based on the number of modules (partly so the client can use Google Tag Manager on elements)

    e.g.

    <div id="<?php echo $unique_id_exclusive_to_this_flexible_content_field ?>">

    I have tried grabbing an unique field key via get_field_object but I can’t quite access what I need.

    (This is the nearest previous forum post to my query: https://support.advancedcustomfields.com/forums/topic/slugperma-id/ – I’m (almost) sure there is a simpler answer though)

    Any help with this would be much appreciated!

    Many thanks!

Viewing 1 post (of 1 total)

The topic ‘Getting a unique ID/slug for Flexible Content modules’ is closed to new replies.