Title: Need to replace old functions.php section with new code
Last modified: August 21, 2016

---

# Need to replace old functions.php section with new code

 *  [Jason](https://wordpress.org/support/users/jason-nocowardcom/)
 * (@jason-nocowardcom)
 * [12 years ago](https://wordpress.org/support/topic/need-to-replace-old-functionsphp-section-with-new-code/)
 * Hi there,
 * I need some .php help.
 * There are two lines in the original theme I need to “replace” with two other 
   lines of code in functions.php.
 * **Code to be replaced:**
 *     ```
       $stylesheets .= wp_enqueue_style('theme',  STYLE_WEB_ROOT . '/style.css' , array(), UT_THEME_VERSION, 'screen, projection');
       $stylesheets .= wp_enqueue_style('layout', STYLE_WEB_ROOT . '/layout.css' , array('theme'), UT_THEME_VERSION, 'screen, projection');
       ```
   
 * **Code I want to use instead:**
 *     ```
       $stylesheets .= wp_enqueue_style('theme', get_stylesheet_directory_uri().'/style.css', array(), UT_THEME_VERSION, 'screen, projection');
       $stylesheets .= wp_enqueue_style('layout', THEME_WEB_ROOT.'/layout.css', array('theme'), UT_THEME_VERSION, 'screen, projection');
       ```
   
 * Basically the second group of code is from a developer my client used before 
   me and they “customized” a theme for them by messing with all the parent files.
   I’m moving everything to a child theme but don’t know .php to make this change.
 * Thanks in advance for your help!
    Jason

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years ago](https://wordpress.org/support/topic/need-to-replace-old-functionsphp-section-with-new-code/#post-4972194)
 * That’s not how you use wp_enqueue_style(). Have you reviewed [http://codex.wordpress.org/Function_Reference/wp_enqueue_style](http://codex.wordpress.org/Function_Reference/wp_enqueue_style)–
   especially the first example?
 *  Thread Starter [Jason](https://wordpress.org/support/users/jason-nocowardcom/)
 * (@jason-nocowardcom)
 * [12 years ago](https://wordpress.org/support/topic/need-to-replace-old-functionsphp-section-with-new-code/#post-4972274)
 * Thanks for the response, esmi.
 * I actually didn’t write either bit of code. They are from the original theme 
   developer and the developers who pretended the original theme was theirs. I have
   to figure out how to make them play nicely because the pretending devs broke 
   a bunch of stuff through their parent-file editing.
 * The page is helpful, though. It looks like the difference is “STYLE_WEB_ROOT”
   vs “THEME_WEB_ROOT” for the $src slot of “layout” and “STYLE_WEB_ROOT” vs “get_stylesheet_directory_uri()”
   for “theme”.
 * This may be an impossible question to answer without digging in to all the code,
   but what’s the impact of these changes? If I’m reading the link you sent correctly,
   they are just calling different parts of the theme for the design, right?
 * Thanks!

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

The topic ‘Need to replace old functions.php section with new code’ is closed to
new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jason](https://wordpress.org/support/users/jason-nocowardcom/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/need-to-replace-old-functionsphp-section-with-new-code/#post-4972274)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
