How to add custom code in child theme’s functions.php

You are here:
Estimated reading time: 1 min

Basic code editing method

The easiest way of editing the child theme’s functions.php file to add your custom code is to:

  1. Open Appearance > Theme Editor;
  2. Select Rey-child in the top right select list;
  3. Click on the Theme Functions.
  4. Add your custom code in the editor.

Please make sure the code is valid and doesn’t have errors. Otherwise you can lockdown your site. Normally the safest way is through FTP or cPanel’s File manager, however if you know exactly that your code is valid, please proceed.

Alternative methods

If the basic method described above fails for whatever reason, you can try using some of these plugins:

Filester – File Manager Pro. This plugin provides access to the entire root.

Frequently needed codes

Adding Facebook Pixel Code

// Begin Facebook Pixel Code
add_action( 'wp_head', function(){
<!-- Replace this line with Pixel Code provided by Facebook -->
} );
// End Facebook Pixel Code

Other articles:

Was this article helpful?
Dislike 0
Views: 2236

Suggest article improvements

Please use this form to suggest improvements and report missing or outdated content. Support requests will most likely not be answered and it's best to use the Support Request Form instead. Thanks!