Our NEW documentation is now available at http://datafeedrapi.helpscoutdocs.com/
These support forums are now read-only.

Support

Creating a custom plugin

Sometimes you'll need to add custom code to your WordPress site in order to change the functionality of Datafeedr or WooCommerce. Adding custom code to your theme's functions.php file is OK but you run the risk of deleting all of your work when you upgrade your theme.

The best way to add custom code to your website is by writing your own WordPress plugin and adding the necessary code to that file.

We've prepared a custom plugin file that you can use on your site. Here's how to get started with that code.

  1. Download the my-custom-code.zip plugin.
  2. Log into your WordPress Admin area.
  3. Go to Plugins > Add New > Upload
  4. Upload the my-custom-code.zip plugin.
  5. Once the plugin has been successfully installed, activate the plugin.
  6. To add your custom code to the plugin, go to Plugins > Editor.
  7. In the upper-right corner of the Editor page select "My Custom Code" from the "Select plugin to edit" menu.
  8. Now you should see some code loaded in the editor. Look for the line that reads:
    /** Add your custom code BELOW this line **/
  9. Paste the PHP code that you need underneath that line.
  10. After you've finished adding your custom code, click the [Update File] button.

IMPORTANT: If the code you are pasting begins with the line <?php or ends with the line ?>, DO NOT include those lines in your custom code. Adding those lines will potentially break your site.

Now you've added your own custom code to your site. If you need to add more code in the future, just add it below the code you just added.

Created: January 27, 2014 at 10:40 am

Updated: January 31, 2017 at 1:19 pm

Author: Eric