Title: foreach () problem
Last modified: August 18, 2016

---

# foreach () problem

 *  [dommega](https://wordpress.org/support/users/dommega/)
 * (@dommega)
 * [21 years ago](https://wordpress.org/support/topic/foreach-problem/)
 * Everytime I try to combine two variables in the foreach() command I get an error.
   This is what I am trying to do: foreach ($postitle && $pagecontent as $page):
 * How do I get it to work?

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

 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [21 years ago](https://wordpress.org/support/topic/foreach-problem/#post-209785)
 * what specifically are you trying to accomplish?
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years ago](https://wordpress.org/support/topic/foreach-problem/#post-209793)
 * This is the official usage of the foreach() command. Is what you are doing even
   legal?
 * [http://us3.php.net/foreach](http://us3.php.net/foreach)
 * Regards
 *  Thread Starter [dommega](https://wordpress.org/support/users/dommega/)
 * (@dommega)
 * [21 years ago](https://wordpress.org/support/topic/foreach-problem/#post-209829)
 * define legal? funny question. I am trying to adjust the include_page plugin to
   show the page titles as well.
 *  [Cypher](https://wordpress.org/support/users/cypher/)
 * (@cypher)
 * [21 years ago](https://wordpress.org/support/topic/foreach-problem/#post-209971)
 * Legal is a PHP coding sense not Police sense. 🙂
 *  [ColdForged](https://wordpress.org/support/users/coldforged/)
 * (@coldforged)
 * [21 years ago](https://wordpress.org/support/topic/foreach-problem/#post-209979)
 * Looking at the plugin code, you don’t need to modify the `foreach` at all, you’ll
   modify the `echo` line and you’ll need to modify the `SELECT` call from the database.
   To be honest, though, it sounds like you may be over your head here.

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

The topic ‘foreach () problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 4 participants
 * Last reply from: [ColdForged](https://wordpress.org/support/users/coldforged/)
 * Last activity: [21 years ago](https://wordpress.org/support/topic/foreach-problem/#post-209979)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
