Have you ever wanted to be able to quickly modify the Thesis media box, and turn it into a widget-ready area? The tutorial below outlines the steps you need to take to make that happen. This is especially useful if you use NextGen Gallery and want to be able to display random image from the gallery, directly in the media box.
Step 1 - Open your custom_functions.php file and add the following.
1 2 3 4 5 6 7 | if ( function_exists('register_sidebar') ) register_sidebar(array( 'name'=>'Media Box', 'before_widget' => '<li class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3>', 'after_title' => '</h3>')); |
Step 2 – While still in custom_functions.php add this.
1 2 3 4 5 6 7 8 | function mediabox_widget() { echo '<ul class="sidebar_list">'; if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Media Box') ) : echo '</ul>'; endif; } add_action('thesis_hook_multimedia_box', 'mediabox_widget'); |
Step 3 - Enable “custom code” for the media box, under the Thesis Options admin panel.
Step 4 - Go to the widgets admin area, select “Media Box” and add your widgets.
That’s it! Easy, right?
{ 23 comments… read them below or add one }
Does this work with Thesis 1.5.1? I can’t get it to show up on my (test) site. Step 3 above doesn’t work, as the Media Box doesn’t show up in the Thesis Options admin panel. Step 4 seems to work OK, however.
A similar widget from rickbeckman.org fails in the same way: seems to set up but not show up. Maybe Thesis 1.5.1 has a conflict?
Hi Kelly,
I followed this tut tonight and worked flawlessly. However, check where you are looking for the Multimedia Box Options. Its on the “Design Options” panel and not the “Thesis Options” panel.
Adam, you may want to update that info.
Hope this helps.
-Berchman
http://www.berchman.com
I’m just starting to build this site, (www.theposhfrog.com) and can’t seem to get it to work either….
Berchman,
Can you take a look at my site and tell me why it’s not working? I’ve gone back through and can’t figure it out. The tutorial is straight-forward, I just must be doing something not quite right!
Thanks in advance!
-Kelli
http://www.theposhfrog.com
Hey Adam — I just tried to insert this into my custom.php folder at it crashed it — says there was some invalid code in there, so I had to go back and strip it out again to get my site back up. I don’t know why this is (just posted something about it on the Thesis forum in fact) but figured I’d let you know just in case it’s not something on my end…
This solution should work just fine. For those who encountered any problems, you might have forgotten to rename the folder where custom_functions.php is located from “custom-sample” to “custom”. It is necessary to activate custom functions in Thesis.
Thanks for the tut/code, but what would this be good to use for? I’m new to Thesis and blogging and not sure what this would come in handy for. Thanks!
This is exactly what I was looking for… worked perfectly, thanks!
Thanks for sharing!! It works great in wp 2.9.1 and Thesis 1.6.
Thanks a lot
Bye
Thanks for the howto! I’m using thesis for the first time on a clients site. Plan on using it for my sites also. It’s so easy to use makes me wonder why I have waited this long.
If you’re copying directly from above, a tab may get inserted causing an error. You’ll get an unexpected & at line 44. I just escaped it and it worked. Haven’t tried just removing yet.
Thanks for this. I put a post excerpt with photo into my box, loving that, at http://74.53.42.62/~admin/ Now I am hoping I can figure out how to rotate them or make a different one appear on each page of the site; have you been asked about how to make this work in either of those ways? I suppose one could add an “if is home” to the php, and then end up with mm widget areas for several different pages, perhaps…
I think you might want to try using the widget-me subframework. Using that in conjuncition with the code from this post should do the trick. Let me know how it works out for you -Adam
Worked perfectly.. thanks so much for sharing!
Thanks. This was exactly what I was looking for.
Hello Adam,
Widgetizing Multimedia box worked, but when I tried to put in there the Next-gen gallery widget, the MM box doesn’t seem to work?
Please if you can, how will it work on the widgetized MM box?
Thank you,
Steve price
Thanks for the tutorial, it worked, now I’m just trying to figure out how to style it in CSS, would love some help to get me started, I’m a newbie
Laura
Great tuts. The only thing you need to take care of after adding this code is the css. The styling for the build in widgets is not picked up by the widgetized multimedia box. I added this to custom.css and ik look good now. Reason for adding the .sidebar h3 selector is to make sure I only have to update the styling in one location by overriding the font styling for the two build in widgets areas.
#custom_box {
font-size:1em;
line-height:1.538em;
}
div#multimedia_box h3, .sidebar h3 {
color:#555555;
font-size:1.3em;
line-height:1.385em;
margin-bottom:0.692em;
font-variant:small-caps;
letter-spacing:2px;
}
Worked perfectly.. thanks so much for sharing!
[...] or you can use “Custom Code” to really think outside of the box (ha). You can also widgetize it if you so [...]
Sadly it doesn’t work with Thesis 1.8 and Wordpress 3.0.4
Worked great for my nextgen slideshow! Thanks!
Oh p.s. to Soccerwidow, not sure about 1.8 but I installed it on 1.82 and WordPress 3.2
{ 2 trackbacks }