Is it possible to create multiple “custom background” administration pages? A site I’m doing now needs 2 different background in 2 different areas, I would really love giving my client the same experience for both backgrounds in terms of colour/image/select-repeat etc.
Any Ideas?
Leave a Reply
You must be logged in to post a comment.
Hi @Amit:
The answer is “Yes, it is possible.” The follow up question is “Do you really want to?”
I thought it would be fun to see if I could build a plugin to do what you are asking for so I decided to see if it was possible. Of course I was able to make it work but I fear that the plugin code I wrote needs to be so tightly coupled with the existing code in WordPress that it might easily break on a core update.
This code handles all the admin console side of things by creating a new menu item in the Appearance section called “Special Background.” What it does not do is provide any way to actually use the background; that’s phase two of the plugin and will require hooking many of the functions in
/wp-includes/themes.php
and frankly I don’t know if I’ll get a chance to write that code.The reason I stopped without doing it is I didn’t know the requirements for where the special background should show and where the regular one would show. I assume maybe for selected pages and/or URL paths?
Nonetheless, here if the code for the plugin (which you can also download from gist):
Frankly it is too much code to explain proactively but I’ll be happy to answer specific questions.
Technically it’s possible (so to extend the wordpress source), but not by default. So I would give the answer to no. The build-in background theme feature is for a single graphics only be default.
But if you describe a little bit more about the “2 different areas” you’re writing about, there might be something nice to suggest next to this.
Edit: Highlight for MikeSchinkel. Plugins are extending the wordpress source.