In some cases you may need to add a custom function to modify VEM functionality, either to hook something into the plugin, or use a filter to change something in the plugin.
When working with PHP, you want to make sure you have access to your server via FTP or File Manager (through your hosting control panel). This is due to how unforgiving PHP is, if there’s an error in the code, your site can turn into a blank white page. To fix this, simply go into your server and delete the code you added.
NOTE: we strongly recommend testing all PHP code using a local or staging/sandbox environment and only install on your live site once it has been thoroughly vetted.
Adding PHP Using The Code Snippets Plugin
The Code Snippets plugin is a great way to add PHP snippets to your website. You can activate and deactivate certain snippets, and even adds notes about what they do. It’s also more forgiving when handling PHP errors and avoiding the white screen of death.
Adding PHP Using Functions.php File
We do not recommend editing your parent theme’s functions.php file directly as you’ll end up losing those edits whenever you update your theme. Instead, use a child theme and add custom snippets to its functions.php file.