if plugin is active? check if plugin is enabled or not?

Question

I’m using the mingle plugin and the mingle-forum plugin.

I want to show a certain part on my site only if those two plugins are active. How can I solve this?

<?php if ( is_plugin_active('mingle-forum') ) { ?>
                    <div id="login"><?php include (TEMPLATEPATH . '/inc/userlogin.php' ); ?></div>
                <?php } ?>

This throws a php error. Call to undefined function is_plugin_active

Any idea what I’m doing wrong?

update:

<?php if ( plugin_active('plugin-directory/mingle-forum/wpf-main.php') ) { ?>
                    <div id="login"><?php include (TEMPLATEPATH . '/inc/userlogin.php' ); ?></div>
                <?php } ?>
in progress 0
, , mathiregister 10 years 2011-04-21T07:35:18-05:00 0 Answer 84 views 0

Answer ( 1 )

    0
    2021-08-05T12:54:59-05:00

    This function exists in wp-admin/includes/plugin.php so I’m assuming it doesn’t get included by the theme.

    You can either require it, or just create your own version of it – see here: http://wordpress.org/support/topic/is_plugin_active

    UPDATED:

    Please check is_plugin_active

Leave an answer

Browse
Browse