• Jason

    (@jason-nocowardcom)


    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

    (@esmi)

    That’s not how you use wp_enqueue_style(). Have you reviewed http://codex.ww.wp.xz.cn/Function_Reference/wp_enqueue_style – especially the first example?

    Thread Starter Jason

    (@jason-nocowardcom)

    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.