Welcome to WebmasterWorld Guest from 54.159.26.69

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Where to put code to change backend

In this case adding buttons to TinyMCE

     

graeme_p

6:54 am on Dec 7, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



I have a function that when hooked up with add_filter, adds a button to TinyMCE.

It works, but the site I got it off suggests putting it in the themes functions.php. This feels wrong. Is there a better place to put this code?

lorax

1:55 pm on Dec 7, 2013 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The short answer is to use a child theme. Does your current theme support child themes? If so, then you create one and modify it to your heart's desire and it won't undermine the parent theme.

[codex.wordpress.org...]

graeme_p

6:09 pm on Dec 7, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



I am not using an existing theme - doing one for the site. My problem was not with modifying the theme, but with backend functionality in a file in the theme folder.

I have not used Wordpress for a while, and its probably just that the approach is different from what I am used to.

Thanks.

Nutter

9:34 pm on Dec 7, 2013 (gmt 0)

10+ Year Member



You could make it a mini plugin. I usually leave layout related stuff in the theme and anything specific to the site that's not layout in a plugin for that site. The advantage there is that if you change themes the functionality doesn't go away.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month