Widgetizing Thesis’ Multimedia Box

What bet­ter way to start my blog­ging blog than to share a tip for WordPress blog­gers using the world’s best theme?

The sub­ject of Thesis’ mul­ti­me­dia box comes up quite a bit on our sup­port forums, with users want­ing to do a vari­ety of things in that area. (Honestly, I’m con­vinced that every theme needs a mul­ti­me­dia box akin to Thesis’; users are doing all sorts of amaz­ing things with it!) One of the ques­tions I haven’t been able to answer up to this point is how to wid­getize the mul­ti­me­dia box area, allow­ing for far more cus­tomiza­tion with­out the need to write or even copy a sin­gle line of code.

The answer comes from one Adam Barber (@adambarber), and the solu­tion was eas­ier than I ever thought!

All that’s required is a sim­ple addi­tion to your custom_functions.php file:

register_sidebar(array('name' => 'Multimedia Box', 'before_widget' => '<li class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3>', 'after_title' => '</h3>'));

function multimedia_box_widgets() {
	echo '<ul class="sidebar_list">';
	dynamic_sidebar('Multimedia Box');
	echo '</ul>';
}
add_action('thesis_hook_multimedia_box', 'multimedia_box_widgets');

The first line reg­is­ters our new “side­bar,” or wid­getized area. We use the same options as used by Thesis’ default side­bars, but we name the area some­thing mean­ing­ful for our pur­pose: “Multimedia Box.”

The third through sev­enth lines cre­ate the func­tion which out­puts our new wid­getized area. Ordinarily, only the sec­ond through fourth of these three lines is needed, and it would be placed in the theme files where we want the wid­gets to appear. However, with Thesis, in order to facil­i­tate the eas­i­est pos­si­ble upgrade expe­ri­ence, we pre­fer to keep all cus­tomiza­tions within the custom/ folder, and we wrap the code we want to add within a func­tion (or, action) which can then be hooked into the appro­pri­ate place within Thesis, which is what the final line of the code does.

Once you have added the code and uploaded the file to your remote Thesis custom/ folder, you will be able to select a new wid­getized area in the Appearance » Widgets panel of your site. In the Appearance » Thesis Options panel, set your mul­ti­me­dia box to use “cus­tom code.” That’s it!

Now, per­haps you want dif­fer­ent items appear­ing on the mul­ti­me­dia box depend­ing on which page you’re vis­it­ing; no prob­lem! Because this is now a wid­getized area, you can con­trol it via the likes of the Widget Logic WordPress plugin!

This entry was posted in Journal. Bookmark the permalink.

35 Responses to Widgetizing Thesis’ Multimedia Box

  1. t says:

    I fol­lowed your instruc­tions exactly and copied and pasted the code. When I add wid­gets to the mm box they show up ok but it repeats at the bot­tom of the side­bar. Any suggestions..

  2. Tinh says:

    I does not work prop­erly and I had errors. Pls advise

  3. Rick Beckman says:

    For that, I would need to know what errors you were receiving. ;)

  4. lavenedora says:

    Is it still nec­es­sary to alter custom_functions.php for this if we are using your Open Hook? Excuse my igno­rance, Rick, but you have cre­ated a fairly new reply to this thread, and you don’t men­tion Open Hook any­where. If we can use Open Hook, we’d put the 2 – 4 lines, where? Multimedia box? Or, is it some­thing you still have to alter the file man­u­ally to do? I’ve been unsuc­cess­ful with any cus­tomiza­tions that require changes to custom_functions.php.

    Also, I’ve been hav­ing lots of dif­fi­culty with cus­tomiza­tions in gen­eral, even with Open Hook – every­thing results in a “pars­ing” error. I don’t know where I can post a gen­eral request for help with these errors – please point me in the right direc­tion. There has to be a sim­ple solution.

  5. Rick Beckman says:

    lavene­dora: There’s an area for OpenHook sup­port on the offi­cial DIYthemes sup­port com­mu­nity, so feel free to seek help there.

    However and unfor­tu­nately, the above code likely won’t work in OpenHook. The first line of the code must be active when the admin panel is called, and none of OpenHook’s boxes per­form any action at all within the admin panel.

    Open your custom_functions.php file, and add the code to the very end of the file. Should work fine, but let me know if it doesn’t.

  6. lavenedora says:

    Thanks, Rick. I’ll give it a try and let you know if there are any issues with plug­ging it directly into custom_functions.php.

  7. t says:

    For some rea­son the plu­gin isn’t work­ing any­more. It was before. Even when I try and add an image through my custom_​function file it doesn’t work. What do you think could be the issue?

  8. Rick Beckman says:

    t: Do you mean OpenHook isn’t work­ing? If so, drop by the OpenHook sup­port forum on the DIYthemes board and explain the sit­u­a­tion — Thesis ver­sion, OpenHook ver­sion, the exact code you’re using, and so on. Thanks.

  9. t says:

    I went to the diy forums but didn’t see a forum for open hook sup­port just a sup­port for 1.5. Is that where I’m sup­posed to post it?

  10. t says:

    I found it but I can tell you here what’s going on…

    I’m run­ning 1.5 v7

    I’m try­ing to cre­ate a box and place it with the plugin…

    Here’s what I put in the after header

    <div class=“commentbox”></div>

    Here’s what’s in my custom.css

    .cus­tom .com­ment­box {bor­der: solid 1px; height: 50px; width: 300px; back­ground: #eeeedd;}

    Here’s the prob­lem. It showed up fine, then i refreshed and it dis­ap­peared. Then I inserted the word “test” between the div tags. It showed up. Then I got rid of the word “test” and just inserted a “t” and the box dis­ap­peared again but the “t” showed up . Then I got rid of the “t” and noth­ing showed up again. Then i put the word “test” in there and just the word “test” shows with no box.

    The box did show up once but I can’t get it back. Any suggestions???

  11. lavenedora says:

    Hey Rick,

    Wooo hoooo … Thanks again for your help. I got the wid­getized mul­ti­me­dia box going. How easy & how cool!

  12. jon soroko says:

    Rick,
    In the Appearance | Editor win­dow — I don’t have a custom_functions.php file — I do have “cus­tom tem­plate” and “func­tions“
    But not custom_​functions
    What am I miss­ing here?
    Jon

  13. jon soroko says:

    Rick
    Found it via FTP — added the addi­tional lines — in Notepad++
    then uploaded it.
    In Appearance | Widgets — don’t see any change.
    Advice?
    Jon

  14. Pingback: 100 Resources for Thesis Wordpress Theme Users | MattFlies.com

  15. Pingback: 27 Links to help you with Thesis — Serradinho

  16. Pingback: Widgetized Multimedia Box For Thesis Theme

  17. Pingback: Thesis Hack: Widget Ready Multimedia Box | Rol!'s Blog

  18. Pingback: links for 2009-06-18

  19. gabe says:

    does this become sort of obso­lete with the open hooks plug-​​in?

  20. Rick Beckman says:

    Not nec­es­sar­ily. OpenHook lets you eas­ily add con­tent to the Multimedia Box, but it still isn’t wid­getized. If you want to eas­ily add wid­gets to the mul­ti­me­dia box, then the tuto­r­ial is still rel­e­vant. Although, I’m not sure it even works these days. May have to revisit it when I have the time.

  21. Pingback: 100 Tài nguyên hữu ích cho người sử dụng Wordpress Thesis Theme | GIẢI PHÁP SỐ

  22. JW says:

    Using the MM Box Widget cre­ated with your sim­ple, much appre­ci­ated cod­ing, I would like to put dif­fer­ent videos on dif­fer­ent pages. How do I do that?

    Thanks in advance.

  23. Rick Beckman says:

    If you’re going to accom­plish that with wid­gets, then you’ll need to use a plu­gin like Widget Logic to con­trol which wid­get appears on which page, then add numer­ous Text wid­gets, each with the code to dis­play a dif­fer­ent video. Each wid­get can then be set to dis­play in a dif­fer­ent con­text using Widget Logic’s controls.

  24. JW says:

    Ah so!
    Thank you for the quick reply…and for all of the work that you do!

  25. Tina says:

    OMG I messed up. I was try­ing to cre­ate a cus­tom 404 page and changed the custom_functions.php page and now I can­not get back into it on the site!!!

    Please HELP!!

    Thanks„

    Tina

  26. Rick Beckman says:

    Remove the code you added to the file. Replace it with an entirely blank file if you have to; there’s likely a syn­tax error in your code that you’ll need to track down before you’ll be able to use the code on your site.

    For fur­ther help, ask on the Thesis sup­port board. Thanks.

  27. Tina says:

    Thank you Rick! I actu­ally did get into the ftp area and accessed the file; removed what I added and it is act­ing bet­ter. At least I am able to log back into the admin pane/​dashboard, but I keep get­ting other weird errors that I can only chalk up to this mis­take. I did save the orig­i­nally cus­tomized php file with an exten­sion and will always have that now if needed.

    I appre­ci­ate your time; thanks again.

    Tina

  28. Pingback: 100 resources for users of the excellent Thesis Theme for Wordpress

  29. Pingback: Tutorials for Full-Width Headers, Widgetized Multimedia Box, and More! | 3asslema4Host

  30. Thomas says:

    ich have suc­cess­fully wid­getized the mul­ti­me­dia box. Thanks Rick!
    But if i put a wid­get like Killer Recent Entries in it, then this wid­get got no styling like the other wid­gets in the side­bar.
    How can i set up the styling for this Multimedia Box Widget?

  31. Rick,
    Thanks! This is great. And I had just recently dis­cov­ered Widget Logic which is fan­tas­tic. Is it pos­si­ble to move the MM Box to the the left side­bar panel ?(using 3 columns on a site) — or any other place also? I’d love the flex­i­bil­ity of mov­ing the box.
    Thanks!

  32. Digital Pill says:

    Yikes, Hi Rick this doesn’t seem to work for me.. :(

    The mul­ti­me­dia box looks good for the home­page, but when you click though to indi­vid­ual post pages, it shows the arti­cle image in its place of expected video for some rea­son.. So it looks like its not pick­ing up the set­ting some­how.. Any idea where I can look? I want to use wid­get logic eventually..

  33. Rick Beckman says:

    I think the arti­cle image takes prece­dent. Disable that on the indi­vid­ual arti­cles and you’ll prob­a­bly be fine. If that’s not the case, you’ll need to ask at Thesis sup­port. I’ve not used the theme for sev­eral ver­sions now, so it may not be behav­ing like I was used to anymore.

  34. Bill says:

    Box is up and run­ning just fine. I’m using an image wid­get. Is there a way to get some styling in there — font size, color, dif­fer­ent head­line font, padding between copy and image so I can move it to the left side of the wid­get? Thanks…

  35. Rick Beckman says:

    You’d have to view the source of your page (or use Firebug to inspect it) so that you know exactly which elements/​classes/​IDs you want to tar­get, then you could eas­ily add what­ever styling you want to your cus­tom stylesheet tar­get­ing the afore­men­tioned elements/​classes/​IDs. Because there is a the­o­ret­i­cal infi­nite com­bi­na­tion of answers due to every setup, every wid­get, and every cus­tomiza­tion being slightly dif­fer­ent, I can’t really be more specific.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>