Anchor text [toc]. How to assign a CSS ID on a query loop?

I have a page where I show summaries of books.
I want to create my own TOC (table of contents), an index with internal links (anchor links).
I am going to extract the summary of each book in a container using a Query loop and I need to assign to each container a CSS ID to be able to link it, as anchor.
How could I assign it ? Perhaps using Style > CSS > Custom CSS ? what code ?

Thanks!

1 Like

Hi Dexx,

This can be done using the attributes feature.

For your query loop repeating item, add a id attribute whose value is post-{post_id}.

11 Likes