Hi agentbey,
I’ve been playing around with this a bit. If you add this to your themes functions.php file you should find a new drop down menu in the responsive theme settings (under homepage) to allow you to choose a homepage slideshow.
/**
* Add Meta Slider dropdown selector to homepage settings
*/
add_filter('responsive_options_filter', 'metaslider_responsive_theme_sections', 10, 1);
function metaslider_responsive_theme_sections($options) {
$slideshows[0] = 'Disabled';
// list the tabs
$args = array(
'post_type' => 'ml-slider',
'post_status' => 'publish',
'suppress_filters' => 1, // wpml, ignore language filter
'posts_per_page' => -1
);
$the_query = new WP_Query($args);
while ($the_query->have_posts()) {
$the_query->the_post();
$slideshows[$the_query->post->ID] = get_the_title() . ' (ID: ' . $the_query->post->ID . ')';
}
$options['home_page'][] = array(
'title' => __( 'Meta Slider', 'responsive' ),
'subtitle' => '<br />Recommended width: 960px',
'heading' => '',
'type' => 'select',
'id' => 'homepage_meta_slider',
'description' => '',
'placeholder' => '',
'options' => $slideshows
);
return $options;
}
/**
* Output the slideshow to the 'header_end' section of the theme
*/
add_action('responsive_header_end', 'metaslider_responsive_homepage_slider', 10, 1);
function metaslider_responsive_homepage_slider() {
$theme_options = get_option('responsive_theme_options');
if ((is_front_page() || is_home()) && isset($theme_options['homepage_meta_slider'])) {
$slider_id = $theme_options['homepage_meta_slider'];
if ($slider_id > 0) {
echo do_shortcode("[metaslider id={$slider_id}]"); //replace 123 with slider ID
}
}
}
Regards,
Tom