WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] "if" to hide this plugin when deactivated? (3 posts)

  1. Dgold
    Member
    Posted 7 years ago #

    Can someone show me the right code? I'm trying to do what's called Hiding Plugins When Deactivated, in my sidebar template.

    The plugin code I want to check-for is php echo getad('rotate-covers') to prevent an error in my sidebar when Ad Rotator plugin is deactivated. I tried the code below and it didn't seem to work,

    <?php
    if (function_exists('getad')) {
      echo getad('rotate-covers'); ?>

    How do I do the "if" check for this plugin example?

  2. damj
    Member
    Posted 7 years ago #

    opened braces are not closed...
    is that it ?

  3. Dgold
    Member
    Posted 7 years ago #

    That was it, thank you. I didn't know enough about the PHP to recognize that, but you're right. It works!

    <?php
    if (function_exists('getad')) {
      echo getad('rotate-covers'); } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic