Title: Invalid argument error
Last modified: August 21, 2016

---

# Invalid argument error

 *  Resolved [macrocurio](https://wordpress.org/support/users/macrocurio/)
 * (@macrocurio)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/)
 * Hello,
 * I stated using this plugin while developing a site and it worked really well,
   and now I put it online I get the following error:
 * Warning: Invalid argument supplied for foreach() in /home/(username)/(domain)/
   wp-content/plugins/category-posts-in-custom-menu/category-posts-in-custom-menu.
   php on line 168
 * This only occurs if I have put in 2 or more for the number of posts to show for
   the category I have chosen.
 * Is this something I have done? Or is this an error with the plugin?
 * Thanks 🙂
 * [http://wordpress.org/extend/plugins/category-posts-in-custom-menu/](http://wordpress.org/extend/plugins/category-posts-in-custom-menu/)

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

 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880199)
 * Hi,
 * thanks for your message. I’m sorry to hear the plugin isn’t working for you.
 * As you can see on blog.dianakoenraadt.nl, I’ve got the plugin running as well.
   So far I have discovered no problems. Can you please do the following:
 * – Let me know which version of WordPress you are using.
    – Let me know which 
   themes and which plugins you are using, both when developing and online. Is there
   a difference? – Disable the theme and other plugins and tell me what effect this
   has. – Please let me know exactly how you’ve configured your custom menu.
 * On line 168 of the plugin, the custom keys of the post are retrieved and the %
   post_my_field occurrences are replaced. I think you are using a plugin that also
   creates custom keys. Please let me know, I’ll work on it.
 * Kind regards,
    Diana
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880273)
 * I’ve found the reason for this error. At the moment, I’m also doing some other
   changes, so with version 0.7.2 this will be fixed. Please bear with me.
 *  Thread Starter [macrocurio](https://wordpress.org/support/users/macrocurio/)
 * (@macrocurio)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880274)
 * No worries, thanks so much for your efforts 🙂
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880276)
 * Hey,
 * if I’m not mistaken, I’ve fixed this in version 0.7.2
 * Please let me know if your problem is resolved.
 * Kind regards,
    Diana
 *  Thread Starter [macrocurio](https://wordpress.org/support/users/macrocurio/)
 * (@macrocurio)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880282)
 * Yes it’a all fixed now! Thank you so much!
 *  Plugin Author [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * (@anaid)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880283)
 * Great! 🙂 Thanks for reporting it!

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

The topic ‘Invalid argument error’ is closed to new replies.

 * ![](https://ps.w.org/category-posts-in-custom-menu/assets/icon-128x128.png?rev
   =2539336)
 * [Category Posts in Custom Menu](https://wordpress.org/plugins/category-posts-in-custom-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/category-posts-in-custom-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/category-posts-in-custom-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/category-posts-in-custom-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/category-posts-in-custom-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/category-posts-in-custom-menu/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Diana van de Laarschot](https://wordpress.org/support/users/anaid/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/invalid-argument-error-5/#post-3880283)
 * Status: resolved