• Resolved Masha

    (@hellawhateva)


    Hi Jay, I’m trying to find how can I load car-deamon-header.php on cars-for sale page only? Currently it loads in wp_head on default and I find it too extra and slowing the page loads. I’d like to load scripts conditionally, I usually use deregister function, but can’t find how do i deregister car-deamon header, is there a hook for header only? or I found you have a filter in car-deamon.php on line 101 add_filter(‘wp_head’, ‘car_demon_header’);, can i set instead of wp-head car sales page ID? Problem is currently cars-for-sale is using archive-cars_for_sale.php and I have no idea where to find ID, please help!
    Thank you 🙂

    http://ww.wp.xz.cn/extend/plugins/car-demon/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author theverylastperson

    (@theverylastperson)

    Hi Masha,

    If you’ll download the development version from;
    http://downloads.wp.xz.cn/plugin/car-demon.zip

    There is a function in the top of the car-demon-header.php file that now has the css enqueued, you could use wp_dequeue_script & wp_dequeue_style to remove them everywhere they aren’t needed.

    http://codex.ww.wp.xz.cn/Function_Reference/wp_dequeue_script

    I have a note to set several files to load conditionally, I also added a note to add a hook to the header function.

    Thread Starter Masha

    (@hellawhateva)

    Thanks, this helps a lot

    Plugin Author theverylastperson

    (@theverylastperson)

    Just wanted to make sure that you now had the functionality you needed.

    If you run into more bumps go ahead and create a new thread.

    take care,
    -jay

    Thread Starter Masha

    (@hellawhateva)

    Thanks for checking Jay, so far so good, it bumped me from C to B on YSlow and everything works fine right now 🙂

    Plugin Author theverylastperson

    (@theverylastperson)

    Are you using CloudFlare? You can use that to boost it up a little more, especially using their rocket script feature (in beta). It does cause one of my sites to blink right after load,but it shaved my page load time and my YSlow hit A-.

    lydwolf1

    (@lydwolf1)

    Thanks,

    More info stored. Hopefully the mind will be able to retrieve it when necessary.

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

The topic ‘Loading car demon header conditionally’ is closed to new replies.