Title: Error with WPtouch
Last modified: August 24, 2016

---

# Error with WPtouch

 *  Resolved [mayachen](https://wordpress.org/support/users/mayachen/)
 * (@mayachen)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/error-with-wptouch/)
 * I recently installed WPtouch on the site and got this error message.
    Warning:
   Invalid argument supplied for foreach() in /home/…/…/…/wp-content/plugins/gantry/
   functions.php on line 452
 * Warning: Cannot modify header information – headers already sent by (output started
   at /home/…/…/…/wp-content/plugins/gantry/functions.php:452) in /home/…/…/…/wp-
   includes/pluggable.php on line 1178
 *  foreach ($gantry->_setbyurl as $queryvar) { (This is the line on 452)
 * How do I resolve this problem?
 * [https://wordpress.org/plugins/gantry/](https://wordpress.org/plugins/gantry/)

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

 *  Plugin Author [Gantry](https://wordpress.org/support/users/gantry/)
 * (@gantry)
 * [11 years ago](https://wordpress.org/support/topic/error-with-wptouch/#post-5986823)
 * Hi,
 * We haven’t tested comptibility with WPTouch. Are you using a free version of 
   WPTouch ?
 * Thanks,
    Jakub
 *  Thread Starter [mayachen](https://wordpress.org/support/users/mayachen/)
 * (@mayachen)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/error-with-wptouch/#post-5986846)
 * Yes
 *  Plugin Author [Gantry](https://wordpress.org/support/users/gantry/)
 * (@gantry)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/error-with-wptouch/#post-5986851)
 * Hi,
 * I’m very sorry for the late reply. I was out of country and had limited connectivity.
 * Please open functions.php and on line 452 change this code :
 *     ```
       foreach( $gantry->_setbyurl as $queryvar ) {
       	$aVars[] = $queryvar;
       }
       ```
   
 * to this :
 *     ```
       if( $gantry !== null ) {
       	foreach( $gantry->_setbyurl as $queryvar ) {
       		$aVars[] = $queryvar;
       	}
       }
       ```
   
 * I will include this in the next Gantry update.
 * Thank you and one more time sorry!

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

The topic ‘Error with WPtouch’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/gantry_4d4f51.svg)
 * [Gantry 4 Framework](https://wordpress.org/plugins/gantry/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gantry/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gantry/)
 * [Active Topics](https://wordpress.org/support/plugin/gantry/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gantry/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gantry/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Gantry](https://wordpress.org/support/users/gantry/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/error-with-wptouch/#post-5986851)
 * Status: resolved