WordPress.org

Ready to get started?Download WordPress

Forums

'include' doesn't work in my-hacks.php (4 posts)

  1. Anonymous
    Unregistered
    Posted 9 years ago #

    I'm finding that 'include("somefile.php") ' doesn't seem to work in my-hacks.php.
    I tried to use the acronymit.php script. Rather than include the entire script in my-hacks.php, I just put a line like this in my-hacks.php:
    include('acronymit.php');
    and that didn't work!
    However, when I took the entire contents of acronmyit.php and pasted them into my-hacks.php, it worked!
    Now I'm trying to get the style-switcher working, and it appears that the same problems is arising.
    File permissions are 0644 on my-hacks.php and on acronymit.php, and on wp-style-switcher.php.
    What could I be doing wrong?

  2. Beel
    Member
    Posted 9 years ago #

    <?php
    my-hacks stuff
    ?>
    <?php include('acronymit.php') ?>

  3. Anonymous
    Unregistered
    Posted 9 years ago #

    Sounds like you're suggesting that I include <?php .... ?> around the include statement in the my-hacks.php file. You know, I tried that. I could'a sworn I tried it!
    But I gave your suggestion another try, and it worked! so, thanks!
    Now to figure out why style-switcher won't work....

  4. shade
    Member
    Posted 9 years ago #

    is acronymit.php in the same folder as my-hacks.php? if it's in the root, use /acronymit.php. if it's somewhere else, use path/to/acronymit.php.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.