That’s the trouble with test sites…

I thought it would be a good idea to make sure that small tweak I mentioned yesterday would work as expected on WordPress 3.0, so I copied it to my test site. This was a bit different, as it’s running a child theme, and the main theme, which I want to avoid editing, has its own quite complicated functions.php file. But it seems this has all been carefully thought out. All you have to do is create a functions.php file in the child theme folder, and it will be loaded before the main theme’s file. This also lets you replace functions in the main theme with your own, should you be so inclined. Anyway, after twiddling a bit (changing some more buttons, adding a bit to allow iframes[1]), I uploaded the new functions file and went to the post editing page. Funny, I thought. Those look like the default buttons. Where are my carefully selected ones, eh?

So, I repeated the test on my other test site. This one runs on the iMac, and is useful because it’s got loads of posts in it, so I can see if anything is likely to break. And it worked as expected.

Most odd, I thought. I made sure I had saved the right file, and uploaded it. Looking in my FTP application, I could see the file there. So, I moved back to the command line. I had to do that as there was some other oddness that needed a bit of manual tweaking, so while I was there, I decided to check the files in the child theme. Eh? What? Where’s my functions.php file gone? It was altogether absent, which seemed quite odd.

Back to the FTP program, which showed the file still there, even after I refreshed the window.  OK, this was getting a bit peculiar.

Of course, it was then that I noticed that I’d been uploading the file to the live site which doesn’t actually use that theme. :duh:

Once I’d uploaded to the correct location, the tweak worked.

[1] The WordPress implementation of TinyMCE is set to produce moderately strict XHTML. Which means that the iframe tag isn’t allowed. That would be OK, but post in which I’ve manually inserted Amazon product links, created before I started using a plugin, are a problem. Well, they’re only a problem if I look at them in the WSIWYG editor, which removes the iframes without so much as a “with your leave” or a “by your leave”[2]. Took me a while to realise what was happening there. The HTML editor is nowhere near as rude.
[2] But possibly with a “Poop! Poop!”[3]
[3] No, I’m not explaining that one, so there. :tongue: