Title: index.php multiple loop for different pages.
Last modified: August 20, 2016

---

# index.php multiple loop for different pages.

 *  [deano89](https://wordpress.org/support/users/deano89/)
 * (@deano89)
 * [15 years ago](https://wordpress.org/support/topic/indexphp-multiple-loop-for-different-pages/)
 * hi, im pretty new to all this wordpress stuff and could do with some help.
    I’m
   trying to code an index.php that has 1 loop for a ‘News’ page and 1 loop for 
   a ‘Portfolio’ page. Although I want both loops to do the same thing (display 
   5 posts), how do code it so it differentiates between the ‘News’ page and ‘Portfolio’
   page.
 * thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [deano89](https://wordpress.org/support/users/deano89/)
 * (@deano89)
 * [15 years ago](https://wordpress.org/support/topic/indexphp-multiple-loop-for-different-pages/#post-2086216)
 * anybody help me with the `if_page('so on')`
    would this help me with what i’m
   after. thanks`
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years ago](https://wordpress.org/support/topic/indexphp-multiple-loop-for-different-pages/#post-2086217)
 * [http://codex.wordpress.org/The_Loop#Multiple_Loops](http://codex.wordpress.org/The_Loop#Multiple_Loops)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘index.php multiple loop for different pages.’ is closed to new replies.

## Tags

 * [index.php](https://wordpress.org/support/topic-tag/index-php/)
 * [loops](https://wordpress.org/support/topic-tag/loops/)
 * [multiple loops](https://wordpress.org/support/topic-tag/multiple-loops/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/indexphp-multiple-loop-for-different-pages/#post-2086217)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
