Display Multimedia Box on Home Page Only

This document is deprecated! The information on this page refers to a Thesis version that is now obsolete. Please visit the Thesis Docs for current documentation.

In certain cases, you may want to use the Thesis Multimedia Box to display content, but only on your home page. There are two different approaches you can take to doing this.

If you’re using the Custom Code option for the Multimedia Box, and executing that code from custom_functions.php, then either of the methods which follow should work equally well for you.

But if you want to use either the Rotating Images or Embed a video options for the Multimedia Box, you must use Method 1 — Method 2 specifically activates only the Custom Code Multimedia Box Option (though it can be modified to activate one of the other two Options, there’s not really any point to doing that, because you wouldn’t be able to access the useful in-dash configuration settings for these Options).

Note that, regardless of which method you choose, you’ll still be able to activate the Multimedia Box on the individual post and page level (or on search, archives, etc., by adding the appropriate conditional tag to the custom code necessary to do this), if desired.

Method 1

Enable the Multimedia Box in Design Options, then use the following code in custom_functions.php to disable it everywhere but the home page:

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

Method 2

Disable the Multimedia Box in Design Options, then use the following code in custom_functions.php to enable it only on the home page:

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