Title: Assigning Variable for Order in Sequence
Last modified: August 31, 2016

---

# Assigning Variable for Order in Sequence

 *  [atrag](https://wordpress.org/support/users/atrag/)
 * (@atrag)
 * [10 years ago](https://wordpress.org/support/topic/assigning-variable-for-order-in-sequence/)
 * This should be very simple but its turning out not to be. I want each post to
   display the number in the sequence it is being shown in the query. So this seemed
   very simple to me. Within the loop I put:
 *  `$ordertodisplay++;
    echo $ordertodisplay;`
 * However each post just shows 1. Can you explain what I am doing wrong?

Viewing 1 replies (of 1 total)

 *  [Allison Tarr](https://wordpress.org/support/users/allisonplus/)
 * (@allisonplus)
 * [10 years ago](https://wordpress.org/support/topic/assigning-variable-for-order-in-sequence/#post-7378600)
 * What does your query currently look like? Are you using WP_Query? If so, there
   are different order parameters you can feed it ([https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters)).
   Hope that at least points you in the right direction!

Viewing 1 replies (of 1 total)

The topic ‘Assigning Variable for Order in Sequence’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Allison Tarr](https://wordpress.org/support/users/allisonplus/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/assigning-variable-for-order-in-sequence/#post-7378600)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
