Title: Code working in functions.php but not in Code Snippets plugin
Last modified: February 4, 2018

---

# Code working in functions.php but not in Code Snippets plugin

 *  Resolved [urshadow](https://wordpress.org/support/users/urshadow/)
 * (@urshadow)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/code-working-in-functions-php-but-not-in-code-snippets-plugin/)
 * I am using this code in Genesis Education Pro child theme: [https://my.studiopress.com/documentation/snippets/header/remove-the-site-title/](https://my.studiopress.com/documentation/snippets/header/remove-the-site-title/)
 * //* Remove the site title
    remove_action( ‘genesis_site_title’, ‘genesis_seo_site_title’);
 * It works if I place it in the functions.php but doesn’t if I make a Code Snippet
   for it in the plugin. How can I fix this?

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

 *  [patbell101](https://wordpress.org/support/users/patbell101/)
 * (@patbell101)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/code-working-in-functions-php-but-not-in-code-snippets-plugin/#post-9956758)
 * I guess its to do with when it loads. functions.php loads early.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/code-working-in-functions-php-but-not-in-code-snippets-plugin/#post-9958924)
 * Yep, more or less. Code Snippets run earlier than the themes are loaded, and 
   you cannot remove an action which hasn’t been registered yet.
 * Here’s how you can adjust that snippet so it will work:
 *     ```
       add_action( 'init', function () {
   
       	//* Remove the site title
       	remove_action( ‘genesis_site_title’, ‘genesis_seo_site_title’ );
   
       } );
       ```
   

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

The topic ‘Code working in functions.php but not in Code Snippets plugin’ is closed
to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

## Tags

 * [genesis](https://wordpress.org/support/topic-tag/genesis/)

 * 2 replies
 * 3 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/code-working-in-functions-php-but-not-in-code-snippets-plugin/#post-9958924)
 * Status: resolved