

Please note that WPCode has other options where you could run code snippets, for example run it only for logged-in users, specific pages, or for users who have selected role. If you want to use one of the filter hooks that run on the back-end only, for example, mepr-admin-subscriptions-cols, you can use “Admin Only” option from Location. I could also use “Run Everywhere” option, so my code would run on the entire site including WordPress Dashboard, so the back-end. It means that code snippet will run on front-end only so on all pages where regular users have access including Account page. In the example above I used mepr-account-nav-home-label filter hook to change Home label on Account page on front-end so I used “Frontend Only” as Location. All you need to do is to check/uncheck checkboxes under Status column in Code Snippets table. Your code snippet should work.Įnabling and disabling code snippets is easy.
#Wordpress code snippets install#
Once you install and activate WPCode plugin in Plugins section, you’ll notice Code Snippets section in WordPress Dashboard.
#Wordpress code snippets how to#
We’ll show you how to use one of the code snippets plugins, called WPCode - Insert Headers and Footers + Custom Code Snippets with MemberPress. Using custom code plugin might be a better option because you have more control over your snippets, activate them if you need, avoid possible errors, or use them on the back-end, front-end, or only on particular pages. If you want to add custom code, for example, use one of our action or filter hooks, you can either add the code at the end of your theme’s functions.php file, or use one of the code snippets plugins. Head to Snippets Add New: Add a name for your snippet, paste the snippet in the code area, and then provide a description for your own reference. How to add custom code snippets in WPCode Once you activate the plugin, you will find a Snippets menu right under Plugins.
