WordPress.org

Ready to get started?Download WordPress

Forums

Meta Slider
[resolved] Does MetaSlider support function_exists (5 posts)

  1. dannyfoo
    Member
    Posted 7 months ago #

    Is it possible to use if ( function_exists ( 'function-name' ) ) with the Meta Slider ?

    Because I was looking for the function-name for Meta Slider but couldn't find it.

    http://wordpress.org/plugins/ml-slider/

  2. Matcha Labs
    Member
    Plugin Author

    Posted 7 months ago #

    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

  3. dannyfoo
    Member
    Posted 7 months ago #

    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

  4. Matcha Labs
    Member
    Plugin Author

    Posted 7 months ago #

    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

  5. dannyfoo
    Member
    Posted 7 months ago #

    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. :)

Reply

You must log in to post.

About this Plugin

About this Topic