Title: &#8216;include&#8217; doesn&#8217;t work in my-hacks.php
Last modified: August 18, 2016

---

# ‘include’ doesn’t work in my-hacks.php

 *  midtoad
 * [22 years, 1 month ago](https://wordpress.org/support/topic/include-doesnt-work-in-my-hacksphp/)
 * 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?

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

 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/include-doesnt-work-in-my-hacksphp/#post-48351)
 * <?php
    my-hacks stuff ?> <?php include(‘acronymit.php’) ?>
 *  Thread Starter Anonymous
 * [22 years, 1 month ago](https://wordpress.org/support/topic/include-doesnt-work-in-my-hacksphp/#post-48355)
 * 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….
 *  [shade](https://wordpress.org/support/users/shade/)
 * (@shade)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/include-doesnt-work-in-my-hacksphp/#post-48361)
 * 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.

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

The topic ‘‘include’ doesn’t work in my-hacks.php’ is closed to new replies.

 * 3 replies
 * 3 participants
 * Last reply from: [shade](https://wordpress.org/support/users/shade/)
 * Last activity: [22 years, 1 month ago](https://wordpress.org/support/topic/include-doesnt-work-in-my-hacksphp/#post-48361)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
