Title: Custom Fields File
Last modified: August 30, 2016

---

# Custom Fields File

 *  Resolved [dang621](https://wordpress.org/support/users/dang621/)
 * (@dang621)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-fields-file/)
 * Hello,
 * Fantastic plugin. WPadverts is simple yet very useful and pleasing to the eye.
 * Could I get some help implementing the custom field code indicated here:
 * [http://wpadverts.com/documentation/custom-fields/](http://wpadverts.com/documentation/custom-fields/)
 * I’m having a hard time figuring out which file to insert the code or if I should
   make a new PHP file to contain the custom fields code. Steps on where to insert
   the code would be much appreciated!
 * Thanks
 * [https://wordpress.org/plugins/wpadverts/](https://wordpress.org/plugins/wpadverts/)

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

 *  [bevyme](https://wordpress.org/support/users/bevyme/)
 * (@bevyme)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-fields-file/#post-6825637)
 * Hi dang61,
    You will need to put the custom codes in here: wpadverts/includes/
   defaults.php You might want to create a child for that if your thinking about
   updates. Cheers.
 *  Plugin Author [Greg Winiarski](https://wordpress.org/support/users/gwin/)
 * (@gwin)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-fields-file/#post-6825657)
 * Do NOT put additional code in wpadverts directory as this will be overwritten
   on update, you should either:
    – put the code in your current theme functions.
   php file (although this can be also overwritten when updating the theme) – create
   a new plugin and paste the code there [http://ditio.net/2007/08/09/how-to-create-wordpress-plugin-from-a-scratch/](http://ditio.net/2007/08/09/how-to-create-wordpress-plugin-from-a-scratch/)
 * The second solution is a bit more complex, but i recommend using it as this is
   how you should properly extend WordPress plugins.
 * Basically what you need to do is:
    – create a file my-custom-codes.php – paste
   a plugin header at the top
 *     ```
       <?php
       /*
       Plugin Name: My Custom Codes
       Plugin URI: http://example.com
       Description: Codes which extend WPAdverts
       Author: Greg
       Version: 1.0
       */
       ```
   
 * – below the plugin header paste code WPAdverts documentation.
    – upload this 
   file to wp-content/plugins/ directory – from wp-admin / Plugins panel activate
   the “My Custom Codes” plugin.
 *  Plugin Author [Greg Winiarski](https://wordpress.org/support/users/gwin/)
 * (@gwin)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-fields-file/#post-6825660)
 * You should NOT change any files in wpadverts directory as this will be overwritten
   when the plugin is updated.
 * You should either:
    – paste the code in your current theme functions.php file(
   although this can be overwritten on update as well) – create a new plugin and
   add code from Custom Fields document there
 * Creating a plugin is more difficult but also more reliable and actually this 
   is a proper way to extend any other plugin.
 * What you would need to do is the following
    1. create a file and name it my-custom-
   codes.php 2. add a plugin header to this file
 *     ```
       <?php
       /*
       Plugin Name: My Custom Codes
       Plugin URI: http://example.com/
       Description: Plugin extends WPAdverts functionality.
       Author: Greg
       Version: 1.0
       */
       ```
   
 * 3. below the header add code from WPAdverts documentation.
    4. upload the file
   to wp-content/plugins directory 5. from wp-admin / Plugins panel activate “My
   Custom Codes” plugin.
 * For more information about this please see [https://codex.wordpress.org/Writing_a_Plugin](https://codex.wordpress.org/Writing_a_Plugin)
 *  Thread Starter [dang621](https://wordpress.org/support/users/dang621/)
 * (@dang621)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-fields-file/#post-6825730)
 * Perfect! Created the new file and implemented the code so now it works great.
   Thanks for the support!

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

The topic ‘Custom Fields File’ is closed to new replies.

 * ![](https://ps.w.org/wpadverts/assets/icon-256x256.png?rev=2423472)
 * [WPAdverts - Classifieds Plugin](https://wordpress.org/plugins/wpadverts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpadverts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpadverts/)
 * [Active Topics](https://wordpress.org/support/plugin/wpadverts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpadverts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpadverts/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 4 replies
 * 3 participants
 * Last reply from: [dang621](https://wordpress.org/support/users/dang621/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/custom-fields-file/#post-6825730)
 * Status: resolved