• Resolved mloberg

    (@mloberg)


    I am listing out posts in div’s and want each div to have a different id. So the first post would be <div id="post-1">The first post</div>, the second <div id="post-2">The second post</div>, etc. How would I do this?

Viewing 1 replies (of 1 total)
  • Thread Starter mloberg

    (@mloberg)

    I figured out a way. I declared a variable and set it equal to 1, then at the end of each loop, I just added one to it.

Viewing 1 replies (of 1 total)
  • The topic ‘Giving each post a different div id in the WordPress Loop’ is closed to new replies.