WordPress.org

Ready to get started?Download WordPress

Forums

What's the best way to embed CSS and JavaScript from a plugin? (1 post)

  1. mondalaci
    Member
    Posted 3 years ago #

    Hi guys,

    I'm looking for a way to embed (not include from external files) CSS and Javascript from my plugin.

    The reason of why I wanna do that is becuase I think that making additional HTTP requests is overkill when the external files only weight about 100 bytes each.

    I don't wanna use wp_enqueue_style() and wp_enqueue_script() because of the reasons above. I've just tried the wp_print_scripts and wp_print_styles actions but they seem to be called next to each other which is not good considering that CSS should be embedded at the top and JavaScript at the bottom of the page. Also, I wanna make sure that my script gets embedded after the jQuery include.

    What's the best way to do that?

    Thanks in advance,
    Laci

Topic Closed

This topic has been closed to new replies.

About this Topic