Title: adding custom css &amp; php to child theme
Last modified: October 23, 2018

---

# adding custom css & php to child theme

 *  [sostroski57](https://wordpress.org/support/users/sostroski57/)
 * (@sostroski57)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/)
 * I want to use a custom css and php file with my site. I used the following code
   and it fails on the php file and doesn’t seem to be formatted by the css
 *     ```
        *ACM Plugin activation.
        */
       require_once dirname( __FILE__ ) . '/plugins/xxxxxxx.php';
        *ACM style sheet.
        */
       function custom_style_sheet() {
       wp_enqueue_style( 'custom-styling', get_stylesheet_directory_uri() . '/xxxxxxx.css' );
       }
       add_action('wp_enqueue_scripts', 'custom_style_sheet');
       ```
   
 * Help
    -  This topic was modified 7 years, 7 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).

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

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10805677)
 * Here are some plugins that help you create working child themes:
    [https://wordpress.org/plugins/search/child+theme/](https://wordpress.org/plugins/search/child+theme/)
 * Here is some information about child themes [https://codex.wordpress.org/Child_Themes](https://codex.wordpress.org/Child_Themes)
 *  Thread Starter [sostroski57](https://wordpress.org/support/users/sostroski57/)
 * (@sostroski57)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10808760)
 * I was hoping for a non plugin solution, I have to do this for sites that use 
   our POS software, I don’t want to add the plugin on their sites
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10809189)
 * The plugins typically just help you create the child theme. You don’t need the
   plugin after it’s created, I think.
 *  Thread Starter [sostroski57](https://wordpress.org/support/users/sostroski57/)
 * (@sostroski57)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10809278)
 * Hi have the child theme it was not problem. I just need to figure out how to 
   reference a stylesheet and php file so far I haven’t had any luck. I can put 
   in the the parent function.php but it will get lost if it gets updated.
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10809319)
 * That’s what the original links I gave you are for…
    Your code looks like a plugin(
   comments). It goes in a particular place in a theme, on a particular action hook.
   That’s in the documentation. Also, you can look at child themes from the repository
   and see how they do things. Read the code. It’s there for you to read.
 *  Thread Starter [sostroski57](https://wordpress.org/support/users/sostroski57/)
 * (@sostroski57)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10809496)
 * There is real stuff between the comments and I found the code from that site.
   I have in in the function.php fine in the child theme directory. The php seems
   to be working now but the stylesheet doesn’t
 * require_once dirname( __FILE__ ) . ‘/plugins/myFile.php’;
 * function custom_style_sheet() {
    wp_enqueue_style( ‘custom-styling’, get_stylesheet_directory_uri().‘/
   myStyle.css’ ); } add_action(‘wp_enqueue_scripts’, ‘custom_style_sheet’);
 *  Thread Starter [sostroski57](https://wordpress.org/support/users/sostroski57/)
 * (@sostroski57)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10809505)
 * I want to use myStyle.css in addition to the style.css from the parent.

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

The topic ‘adding custom css & php to child theme’ is closed to new replies.

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [function.php](https://wordpress.org/support/topic-tag/function-php/)
 * [style sheet](https://wordpress.org/support/topic-tag/style-sheet/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [sostroski57](https://wordpress.org/support/users/sostroski57/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/adding-custom-css-php-to-child-theme/#post-10809505)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
