yet another numbering question (3 posts)

  1. agtalpai
    Posted 11 years ago #

    hi, i want to modify my template, and make my post different, so i would like to know, if there's any way to number my post divs like id="post1" id="post2" id="post3" id="post4"...
    i know it's some sort of ++ and foreach problem, but i'm really a php noob...
    thanks for your help indeed!

  2. Syllani
    Posted 11 years ago #

    Not sure of the problem, in the default theme it is there already:

    <div class="post" id="post-<?php the_ID(); ?>">

  3. Cypher
    Posted 11 years ago #

    If your intention is to have unique styling for each post. Then you an set a simple variable called $i = 0; and then just do $i++ each time through The Loop and use it in the div.

    Perhaps you could tell us a little more about what you are trying to accomplish..


Topic Closed

This topic has been closed to new replies.

About this Topic