Title: Re-defnining a function
Last modified: September 1, 2016

---

# Re-defnining a function

 *  Resolved [deuts](https://wordpress.org/support/users/deuts/)
 * (@deuts)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/re-defnining-a-function/)
 * Apparently, this plugin cannot re-define a function as a snippet item.
 * In my functions.php I tried re-defining the function twentysixteen_entry_meta()
   from the TwentySixteen theme, which is found in inc/template-tags.php, in order
   to add custom post taxonomies in the entry post meta. The code I had worked well
   when it was in functions.php, but when I transferred it as snippets of this plugin,
   it didn’t work.
 * Is there a workaround for this, or anything?
 * [https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)

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

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/re-defnining-a-function/#post-7459754)
 * Snippet code runs at a different time in the load order than themes, so perhaps
   that is the issue. Still, it _should_ run before `functions.php`, so I’ll have
   to see what might be going wrong.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/re-defnining-a-function/#post-7459878)
 * Have you tried a snippet like this?
 *     ```
       if ( ! function_exists( 'twentysixteen_entry_meta' ) ) :
   
       function twentysixteen_entry_meta() {
       	echo 'custom entry meta';
       }
   
       endif;
       ```
   
 * I just tested it on my dev site, and it appears to work as expected.
 *  Thread Starter [deuts](https://wordpress.org/support/users/deuts/)
 * (@deuts)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/re-defnining-a-function/#post-7459879)
 * But the function already exists in the twentysixteen **parent theme**, which 
   as I have described is found in inc/template-tags.php.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/re-defnining-a-function/#post-7459880)
 * Yes, I know that, and this snippet defines that function before the inc/template-
   tags.php file is loaded.
 * I just put up an online dev site which is running only the Twenty Sixteen theme,
   the Code Snippets plugin and this snippet – have a look how the entry meta is
   changed.
 * [http://dev.bungeshea.com/wp/](http://dev.bungeshea.com/wp/)

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

The topic ‘Re-defnining a function’ 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

 * [Codes](https://wordpress.org/support/topic-tag/codes/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)

 * 4 replies
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/re-defnining-a-function/#post-7459880)
 * Status: resolved