Hi dannyfoo,
I’m not sure what you mean sorry.
The only way ‘in’ to Meta Slider is through the shortcode, if you need to use it in a template then you can use the template code that you can find in the Usage section of Meta Slider.
If you could let me know what you’re looking to do I might be able to help.
Regards
Tom
Thread Starter
Danny
(@dannyfoo)
Hey Tom, thanks for answering my query.
I’m developing a section in my theme to only show the slideshow if the plugin exists / enabled. Otherwise, it’ll display a “backup” image.
Something like this:
<?php if ( function_exists('MetaSliderPlugin') ) { ?>
<?php echo do_shortcode('[metaslider id=01 percentwidth=100]'); ?>
<?php } else { ?>
<img src="<?php bloginfo('stylesheet_directory') ?>/images/homepage-feature-image.jpg" alt="feature image" />
<?php } ?>
I hope this makes things clearer
Hi Dannyfoo,
You could use is_plugin_active I think.:
<?php if ( is_plugin_active('ml-slider/ml-slider.php') ) { ?>
<?php echo do_shortcode('[metaslider id=01 percentwidth=100]'); ?>
<?php } else { ?>
<img src="<?php bloginfo('stylesheet_directory') ?>/images/homepage-feature-image.jpg" alt="feature image" />
<?php } ?>
Out of interest, who is the theme for? Is it personal or are you planning on releasing it? (If you do release it – great!)
Regards
Tom
Thread Starter
Danny
(@dannyfoo)
Hey Tom, thanks for the heads up about is_plugin_active. Didn’t realize this function was available.
This theme is for a small project I’m doing for a friend. 🙂