• Resolved mmmbisto

    (@mmmbisto)


    I’m a bit stuck, I’m using the Flash Fader plugin, which includes a text file, I was wondering if it was possible to make the if function that I saw in the WordPress documentation to only include the text file if it’s there, otherwise not to include anything?

    The php on the wordpress site for plugins:

    <?php
    if (function_exists(‘FUNCTION NAME’)) {
    FUNCTION_NAME();
    }
    ?>

    The php include on the Flash Fader site:

    <?php
    include (ABSPATH.”wp-content/flashfader/flashfaderhtml.txt”);
    ?>

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • <?php
    $myfile = 'some/path/to/file/thefile.txt';
    if(file_exists($myfile)) {
     include($myfile);
    }
    ?>

    Checks if the file exists, then includes it if it does…

    Is that what you need?

    Thread Starter mmmbisto

    (@mmmbisto)

    Thank you so SO much, it appears to be working fine! You’re an absolute STAR 😀

    🙂

    Glad i could help .. 😉

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘php “if” function help’ is closed to new replies.