Moving from child theme to Code snippets: Code error
-
I’ve followed this tutorial to add custom styling to the wordpress editor. For example, I created a child theme and to
functions.php
I added code such as:function add_style_select_buttons( $buttons ) { array_unshift( $buttons, 'styleselect' ); return $buttons; } add_filter( 'mce_buttons_2', 'add_style_select_buttons' );
It all worked. But now I no longer want to use a child theme but instead add the code by using the Code Snippets plugin. However, when I add the above code (and the same problem is there for other code) as a Snippet and want to activate it, I get the error:
The snippet has been deactivated due to an error on line 2:
Cannot redeclare function add_style_select_buttons.What adjustment do I need to make to the code from the tutorial as to make this work with Code Snippets instead of a Child theme?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Moving from child theme to Code snippets: Code error’ is closed to new replies.