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

You are here:
Estimated reading time: 1 min

LinkBasic 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.

LinkAlternative 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.

LinkFrequently needed codes

LinkAdding Facebook Pixel Code

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

Other articles:

Was this article helpful?
Dislike 0
Views: 1133

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!