Thesis Customization — 3 Useful Tweaks For Customizing Thesis Multimedia Box

Thesis theme for WordPress offers the flexibility of using the multimedia box out-of-the-box. This special box enables you to showcase rotating images, embed video or include any custom code to be executed at runtime. While these options can be directly set under Multimedia Box Default Settings in Thesis Design Options, there is some real cool stuff you can do with Thesis Multimedia Box, like:

  1. Display Multimedia Box On Home Page Only
  2. Display Multimedia Box For Specific Posts Only or,
  3. Widgitize The Multimedia Box To Add Your Favorite Widgets

Isn’t that great! So get ready to roll your sleeves up and try these tricks to make the most of Thesis Multimedia Box.

Display Multimedia Box On Home Page Only

By default, Thesis Multimedia box is enabled for all the pages; be it home page, blog or single post pages. Here is a quick trick for enabling the mulimedia box only for home page to show some specific content, ads, images or video. Add the following code to custom_functions.php to enable multimedia box on home page only.

function mmbox_home_only() {
	global $thesis_design;
	if (is_home())
              {
		$thesis_design->multimedia_box['status'] = "custom";
              }
}
add_action('thesis_hook_before_html','mmbox_home_only');

Display Multimedia Box For Specific Posts Only

There might be some specific requirements which call for showing the multimedia box on specific post pages. You can do do by adding the following code to custm_functions.php and setting the custom fields for specific post to enable the multimedia box.

function do_not_show_mmbox() {
	global $post, $thesis_design;
	$mmbox_single = get_post_meta($post->ID, 'mmbox_single', true);
	if (is_single() && $mmbox_single)
              {
                 $thesis_design->multimedia_box['status'] = "0";
              }
}
add_action('thesis_hook_before_html','do_not_show_mmbox');

The above code checks for the single page with custom field called mmbox_single. If the value of the custom field mmbox_single is set to 1, Thesis theme will set the status of multimedia box to zero signifying that the multimedia box is turned off. So after adding the above code to your custom_functions.php, it is required to set the value of custom field mmbox_single to 1 to disable multimedia box on per post basis.

Widgitize The Multimedia Box

This trick is really awesome. You can actually tweak Thesis multimedia box to add WordPress widgets just like in the sidebars. It just takes to register a new sidebar called Multimedia Box and hook the widgetized multimedia box to default thesis hook for multimedia box: thesis_hook_multimedia_box. Here’s the code for accomplishing the aforementioned task.

register_sidebar(array(
	'name' => 'Multimedia Box',
	'before_widget' => '<li>',
	'after_widget' => '</li>',
	'before_title' => '<h3>',
	'after_title' => '</h3>'));

function widgitized_mmbox() {
	dynamic_sidebar('Multimedia Box');
	}

add_action('thesis_hook_multimedia_box', 'widgitized_mmbox');

What else would you like to do with the multi-featured multimedia box offered by Thesis?

Posted In:

UX & Frontend Design, Code Snippets, Thesis WordPress Theme Framework

Comment on Thesis Customization — 3 Useful Tweaks For Customizing Thesis Multimedia Box

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