WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Giving each post a different div id in the WordPress Loop

[Resolved] Giving each post a different div id in the WordPress Loop

  • 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)
  • 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 ‘[Resolved] Giving each post a different div id in the WordPress Loop’ is closed to new replies.