I’m trying to make a site-specific plugin that displays content via shortcode when the browser resolution is that of a mobile device. I use this in the theme files of another installation, it’s called Mobile Detect on github. The end result is to add a shortcode that displays a MailPoet mailing list form in the middle of content.
The trouble is that I require once the file within the plugin and end up with an uncaught error saying $detect is undefined. So the file isn’t being included. I tried require once in the custom template of the page itself and I still have no luck.
What am I getting wrong?
- This topic was modified 9 months, 2 weeks ago by . Reason: Link moved to link field where it belongs
The page I need help with: [log in to see the link]
- The topic ‘Trouble with require once in a plugin’ is closed to new replies.