Welcome to WebmasterWorld Guest from 54.162.19.123

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Where to put code to change backend

In this case adding buttons to TinyMCE

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

Senior Member from GB 

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

joined:Nov 16, 2005
posts: 2637
votes: 80


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?
1:55 pm on Dec 7, 2013 (gmt 0)

Senior Member from US 

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

joined:Mar 31, 2002
posts:7575
votes: 0


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...]
6:09 pm on Dec 7, 2013 (gmt 0)

Senior Member from GB 

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

joined:Nov 16, 2005
posts: 2637
votes: 80


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.
9:34 pm on Dec 7, 2013 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2004
posts:489
votes: 0


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members