Title: Undefined Variable Notice
Last modified: August 30, 2016

---

# Undefined Variable Notice

 *  Resolved [AndyWarren](https://wordpress.org/support/users/awarren/)
 * (@awarren)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/)
 * I am using the plugin shortcode in a widget. I understand there is a widget available
   for the plugin, however due to the layout of the sidebar I need to use the shortcode.
   The plugin is working; however I have a notice showing in the sidebar now. Please
   see below.
 * `Notice: Undefined variable: shortcode_content in /var/www/html/iridian-group-
   website/wp-content/plugins/enjoy-instagram-instagram-responsive-images-gallery-
   and-carousel/library/enjoyinstagram_shortcode_grid.php on line 31`
 * [https://wordpress.org/plugins/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/](https://wordpress.org/plugins/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/)

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

 *  Plugin Author [mediabeta](https://wordpress.org/support/users/mediabeta/)
 * (@mediabeta)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523351)
 * Hi Andy,
    you can see a screnshot of the your settings backend for the widget?
   Thanks
 *  Thread Starter [AndyWarren](https://wordpress.org/support/users/awarren/)
 * (@awarren)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523358)
 * Hi, thanks for the quick reply. Here’s two screenshots.
 * > [View post on imgur.com](https://imgur.com/l1aRULt)
 * > [View post on imgur.com](https://imgur.com/QT7VvWe)
 *  [liamdesign](https://wordpress.org/support/users/liamdesign/)
 * (@liamdesign)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523438)
 * I have the same problem: [http://madmtb.com/v2_0/instagram/](http://madmtb.com/v2_0/instagram/)
 *  Thread Starter [AndyWarren](https://wordpress.org/support/users/awarren/)
 * (@awarren)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523478)
 * Any update [@mediabeta](https://wordpress.org/support/users/mediabeta/)?
 *  Thread Starter [AndyWarren](https://wordpress.org/support/users/awarren/)
 * (@awarren)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523483)
 * **Scratch that, it actually came back again even with the variable being defined
   before the `foreach()`. So the following does not fix it.**
 * I looked at the plugin file giving the notice. The variable was indeed undefined.
   Inside the `foreach()` starting on line 29 in the `enjoyinstagram_shortcode_grid.
   php` the variable `$shortcode_content` is being concatenated without previously
   being defined. To fix the notice just add `$shortcode_content;` to line 27 in
   that file, or right before the `foreach()` on line 29. Problem solved. [@mediabeta](https://wordpress.org/support/users/mediabeta/)
   please update your plugin file in the repo with this. Thanks!
 *  Thread Starter [AndyWarren](https://wordpress.org/support/users/awarren/)
 * (@awarren)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523484)
 * Ok, adding `$shortcode_content = "";` to line 27 did actually remove the notice.
   Its odd though as `$shortcode_content;` should have done the same thing.
 * In any case, I have resolved the notice, but if there is a better way, please
   share it or push an update to the plugin.
 *  Plugin Author [mediabeta](https://wordpress.org/support/users/mediabeta/)
 * (@mediabeta)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523565)
 * Hi AndyWarren
    thanks a lot for your suggestions and work!
 * We implemented it in the last version published on september 15.
    See you!
 *  Thread Starter [AndyWarren](https://wordpress.org/support/users/awarren/)
 * (@awarren)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523566)
 * Awesome, thanks!

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

The topic ‘Undefined Variable Notice’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/enjoy-instagram-instagram-responsive-
   images-gallery-and-carousel_cab692.svg)
 * [Enjoy Social Feed plugin for WordPress website](https://wordpress.org/plugins/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/)
 * [Active Topics](https://wordpress.org/support/plugin/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enjoy-instagram-instagram-responsive-images-gallery-and-carousel/reviews/)

## Tags

 * [enjoy instagram](https://wordpress.org/support/topic-tag/enjoy-instagram/)
 * [undefined variable](https://wordpress.org/support/topic-tag/undefined-variable/)

 * 8 replies
 * 3 participants
 * Last reply from: [AndyWarren](https://wordpress.org/support/users/awarren/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/undefined-variable-notice-5/#post-6523566)
 * Status: resolved