Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nomadgraphix

    (@nomadgraphix)

    To fix this issue…I downloaded a legacy version of WordPress. Apparently, this is a real issue within the WordPress build.

    Thread Starter nomadgraphix

    (@nomadgraphix)

    Keesiemeijer,

    This is fine, but I want to add the stylesheet before all scripts…and I want a simple statement at the beginning of each template:

    add_stylesheet(‘home.css’);

    That is why I am using a custom hook.

    Thread Starter nomadgraphix

    (@nomadgraphix)

    Hey Jan,

    Thanks for the response.

    Your solution works flawlessly!

    but…

    I am using a custom hook to add my stylesheets the the header because I am attempting to improve my site performance by having this order in my header:

    1. Stylesheets
    2. Other <link> tags.
    3. Scripts

    My custom hook code in my function.php file is:

    if(!function_exists('stylesheet_hook')):
    function stylesheet_hook() {
    	do_action('stylesheet_hook');
    }
    endif;

    Then, my header has the hook right after the main stylesheets:

    <link rel="shortcut icon" href="<?php bloginfo('template_url') ?>/images/logo.ico" />
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/nivo-slider/nivo-slider.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/nivo-slider/themes/default/default.css" type="text/css" media="screen" />
    <?php
    stylesheet_hook(); ?>

    Which hook in the header does wp_enqueue_style() use? The “enqueue_script()”?

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