Glossary E Enqueue


The best way to load custom scripts (JavaScript) and styles (CSS) into WordPress is to use the wp_enqueue_scripts hook. Rather than merely hard-coding scripts and styles into your Child Theme it is best to load them into this dynamic system so you can take precise control over where they load on your site. Not all scripts and styles are needed on every page, and it can be beneficial to your site’s overall speed to use PHP logic to add and remove them when needed. Using MD’s Scripts Manager can make this process even easier.

Code example:

function md_child_enqueue() {
    wp_enqueue_script( 'md-child-script-name' . '' );
    wp_enqueue_style( 'md-child-style-name' . '' );
add_action( 'wp_enqueue_scripts', 'md_child_enqueue' );

Learn more from the WordPress Developer Guide.

More WordPress and MD Terms

Explore the full glossary for more key phrases and definitions.




Always Keep Learning

Get New Definitions, MD Releases, and Other Downloads Sent to Your Email

Join the MD newsletter to get new website tools, strategies, and other bonus downloads sent to your email in a respectful manner. If you use Marketers Delight to power your website, you do not want to miss out on these emails!

Start building your website with MD now

Get started with MD today. Pay once for use on unlimited websites.
* Save 40% on license key renewals every 12 months. Get auto-updates sent to 5 websites.

Start building smarter websites today

You can use the Marketers Delight WordPress Theme on unlimited sites.

New features & updates are delivered to sites with your active license key.

Add to Cart — $97

  • 5 sites license
  • 1 year of updates
  • Full access to downloads
  • Verified forums account
  • Save 40% on renewals