Dynamic Data as CSS ID? -or- Another Way to Jump to Dynamic Data?

I have two queries separated into their own loops- a loop for buttons and a loop to display groups from a custom post type. I want to make it so the button takes you to the group rendered below with the same name. I was hoping I could just put {post_slug} as the CSS ID and then have the button link to #{post_slug} but that did not work. I’d surely be able to get this working with some JavaScript but I’d like to avoid that if possible.

Any solutions?

Hey @notMateo,

Yes, this should be possible without JavaScript. :slight_smile:

On the repeated target element, set the CSS ID (Style → CSS → CSS ID) to a dynamic value without the #, for example group-{post_slug}. Then set the button/link URL in the other loop to the same value with the hash, for example #group-{post_slug}.

This should work :slight_smile:

Matej

Exactly what I was looking for awesome!