How can I edit my enqueue script function to include Internet Explorer and page template stylesheets?
<p>In my Wordpress theme I've been using an enqueue script function that adds my jQuery scripts and my stylesheets to my site. Because I have a separate page template as well as my standard page.php , I've been using the 'if' and 'else' commands as written in the code below, to differentiate between the two stylesheets. </p>

<pre><code>&lt;?php

/* ENQUEUE SCRIPTS AND STYLESHEETS ----------- */

function mywebsite_scripts() {

/* JAVASCRIPT ----------- */

    wp_enqueue_script(
    'mywebsite_scripts-menu-toggle',
    get_template_directory_uri() . '/js/menu-toggle.js' );

    wp_enqueue_script(
    'mywebsite_scripts-add-submenu',
    get_template_directory_uri() . '/js/add-submenu.js' );

    wp_enqueue_script(
    'mywebsite_scripts-upanddown',
    get_template_directory_uri() . '/js/upanddown.js' );

/* END JAVASCRIPT ----------- */

/* PAGE TEMPLATE STYLESHEETS ----------- */

    if (is_page_template('page-templates/full-page.php')) 
    { wp_enqueue_style( 'mywebsite_scripts-full-page' , 
    get_template_directory_uri() . '/css/full-page.css'); }     

/* END PAGE TEMPLATE STYLESHEETS ----------- */

/* MAIN STYLESHEET ----------- */

    else { wp_enqueue_style( 'mywebsite_scripts_style', get_stylesheet_uri() ); } }

/* END MAIN STYLESHEET ----------- */

add_action( 'wp_enqueue_scripts', 'mywebsite_scripts_scripts' );

/* END ENQUEUE SCRIPTS AND STYLESHEETS ----------- */
</code></pre>

<p>When I began attempting to make my theme compatible with earlier versions of Internet Explorer, I followed this tutorial: <a href="https://gist.github.com/wpscholar/4947518" rel="nofollow noreferrer">https://gist.github.com/wpscholar/4947518</a> </p>

<p>This code works when I add it to my functions folder, but doesn't allow for the javascript enqueues or extra page template stylesheets that I need. </p>

<pre><code>&lt;?php

function enqueue_my_styles()
{

    global $wp_styles;

    // LOAD THE MAIN STYLESHEET 
    wp_enqueue_style('mywebsite_scripts_style', get_stylesheet_uri());

    wp_enqueue_style('mywebsite_scripts_style_ie8', get_stylesheet_directory_uri() . '/css/ie8.css', array(
    'mywebsite_scripts_style'
    ));
    $wp_styles-&gt;add_data('mywebsite_scripts_style_ie8', 'conditional', 'IE 8');

    wp_enqueue_style('mywebsite_scripts_style_ie9', get_stylesheet_directory_uri() . '/css/ie9.css', array(
    'mywebsite_scripts_style'
    ));
    $wp_styles-&gt;add_data('mywebsite_scripts_style_ie9', 'conditional', 'IE 9');

}

add_action('wp_enqueue_scripts', 'enqueue_my_styles');
</code></pre>

<p>I've tried to combine the two codes and ended up with the code below. Although it hasn't given me any PHP errors, it doesn't load the I.E stylesheets, and simply seems to revert back to the very first code above. Can anyone help me by pointing out what I've done wrong? What I wanted to achieve by combining these codes is the ability to add stylesheets for multiple page templates, and also have the I.E dependent stylesheets that inherit the styles from my style.css and only overwrite the necessary CSS rules to work on older browsers. I also need my Javascript to work too.</p>

<p>I hope all this is possible, any help would be much appreciated as I've tried my best to make it work and I'm not sure where I'm going wrong.</p>

<pre><code>/* ENQUEUE SCRIPTS AND STYLESHEETS ----------- */

function mywebsite_scripts_scripts() {

/* JAVASCRIPT ----------- */

    wp_enqueue_script(
    'mywebsite_scripts-menu-toggle',
    get_template_directory_uri() . '/js/menu-toggle.js' );

    wp_enqueue_script(
    'mywebsite_scripts-add-submenu',
    get_template_directory_uri() . '/js/add-submenu.js' );

    wp_enqueue_script(
    'mywebsite_scripts-upanddown',
    get_template_directory_uri() . '/js/upanddown.js' );

/* END JAVASCRIPT ----------- */

/* PAGE TEMPLATE STYLESHEETS ----------- */

    if (is_page_template('page-templates/full-page.php')) 
    { wp_enqueue_style( 'mywebsite_scripts-full-page' , 
    get_template_directory_uri() . '/css/full-page.css');      

    wp_enqueue_style( 'mywebsite_scripts-full-page_ie', get_stylesheet_directory_uri() . '/css/full-page-ie8.css', 
    array( 'mywebsite_scripts-full-page' ) ); $wp_styles-&gt;add_data( 'mywebsite_scripts-full-page_ie', 'conditional', 'IE 8' ); 

} 

/* END PAGE TEMPLATE STYLESHEETS ----------- */

/* MAIN STYLESHEET ----------- */

    else { wp_enqueue_style( 'mywebsite_scripts_style', get_stylesheet_uri() ); 

    wp_enqueue_style( 'mywebsite_scripts_style_ie8’, get_stylesheet_directory_uri() . '/css/ie8.css', 
    array( 'mywebsite_scripts_style' ) ); $wp_styles-&gt;add_data( 'mywebsite_scripts_style_ie8’, 'conditional', 'IE 8' ); 

} }

/* END MAIN STYLESHEET ----------- */

add_action( 'wp_enqueue_scripts', 'mywebsite_scripts_scripts' );

/* END ENQUEUE SCRIPTS AND STYLESHEETS ----------- */
</code></pre>

<p>*** UPDATE</p>

<pre><code>&lt;?php

/* ENQUEUE SCRIPTS AND STYLESHEETS ----------- */

function mywebsite_scripts_scripts() {

/* JAVASCRIPT ----------- */

    wp_enqueue_script(
    'mywebsite_scripts-menu-toggle',
    get_template_directory_uri() . '/js/menu-toggle.js' );

    wp_enqueue_script(
   'mywebsite_scripts-add-submenu',
    get_template_directory_uri() . '/js/add-submenu.js' );

    wp_enqueue_script(
    'mywebsite_scripts-upanddown',
    get_template_directory_uri() . '/js/upanddown.js' );

/* END JAVASCRIPT ----------- */


if (is_page_template('page-templates/full-page.php')) 

    { wp_enqueue_style( 'mywebsite_scripts-full-page' , 
    get_template_directory_uri() . '/css/full-page.css'); 

}


else { wp_enqueue_style( 'mywebsite_scripts_style', get_stylesheet_uri() );

    wp_enqueue_style( 'mywebsite_scripts_style_ie9', get_stylesheet_directory_uri() . '/css/ie9.css', 
    array( 'mywebsite_scripts_style' ) );

    wp_style_add_data( 'mywebsite_scripts-style_ie9', 'conditional', 'IE 9' );

} }

add_action( 'wp_enqueue_scripts', 'mywebsite_scripts_scripts' );
</code></pre>

<p>*** UPDATE</p>

<p>Ok I've managed to get this to work, but only with the first method using global styles. I'm still not sure why the updated version isn't working.</p>

<pre><code>/* ENQUEUE SCRIPTS AND STYLESHEETS ----------- */

function mywebsite_scripts_scripts() {


/* JAVASCRIPT ----------- */

    wp_enqueue_script(
    'mywebsite_scripts-menu-toggle',
    get_template_directory_uri() . '/js/menu-toggle.js' );

    wp_enqueue_script(
    'mywebsite_scripts-add-submenu',
    get_template_directory_uri() . '/js/add-submenu.js' );

    wp_enqueue_script(
    'mywebsite_scripts-upanddown',
    get_template_directory_uri() . '/js/upanddown.js' );

/* END JAVASCRIPT ----------- */


/* PAGE TEMPLATE STYLESHEETS ----------- */

global $wp_styles;

if (is_page_template('page-templates/full-page.php')) 
    { wp_enqueue_style( 'mywebsite_scripts-full-page' , 
    get_template_directory_uri() . '/css/full-page.css');      
} 

/* END PAGE TEMPLATE STYLESHEETS ----------- */


/* MAIN STYLESHEET ----------- */

else { wp_enqueue_style( 'mywebsite_scripts_style', get_stylesheet_uri() );

wp_enqueue_style( 'mywebsite_scripts_style_ie8', get_stylesheet_directory_uri() . '/css/ie8.css', array( 'mywebsite_scripts_style' ) ); 
$wp_styles-&gt;add_data( 'mywebsite_scripts_style_ie8', 'conditional', 'IE 8' ); 

wp_enqueue_style( 'mywebsite_scripts_style_ie9', get_stylesheet_directory_uri() . '/css/ie9.css', array( 'mywebsite_scripts_style' ) ); 
$wp_styles-&gt;add_data( 'mywebsite_scripts_style_ie9', 'conditional', 'IE 9' ); 

} }

/* END MAIN STYLESHEET ----------- */

add_action( 'wp_enqueue_scripts', 'mywebsite_scripts_scripts' );

/* END ENQUEUE SCRIPTS AND STYLESHEETS ----------- */
</code></pre>