Yes this is fine and is a good practice, especially if your site may switch between HTTPS/HTTP (like for a shopping cart etc) that way you are not loading mixed content.
As long as the CDN you are pulling from offers both HTTPS and HTTP you’re fine, which they do.
Related Posts:
- Worthwhile to restrict direct access of theme files?
- How to enqueue script if widget is displayed on page?
- Should `get_template_directory_uri()` be escaped?
- Why I can’t add a CSS style in this WordPress theme?
- Is it good to rename theme folder downloaded from WordPress.org?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- How to sanitize select box values in post meta?
- Is there a way to set the order of wp_footer hooked functions?
- When to use esc_url, esc_html, esc_attr, and friends?
- Worthwhile to restrict direct access of theme files?
- What can I hook into after_setup_theme?
- What does “Do not deregister the jquery script in the administration area” mean?
- Where i should not use if (!defined(‘ABSPATH’)) { exit; }?
- How do you enqueue script tags for ReactDOM in WordPress’ functions.php?
- using wp_enqueue_script to attach jquery-ui
- Enqueued Stylesheets Effecting Admin Styles
- wp_enqueue_script being ignored in custom theme
- Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?
- Getting jquery to work with custom theme
- Adding wp_enqueue_media(); causes problem
- Is there a filter for enqueue script to strip the type=”text/javascript” property
- Including Javascript options
- Is my approach to enqueue styles inefficient?
- functions.php not hooking up with style.css
- way to include own functions independent of theme
- How to To Filter wp_enqueue_script() Scripts on Some Pages
- How to add Bootstrap Tour JavaScript to WordPress Admin Panel Dashboard Widget
- Difficulty loading jQuery with wp_enqueue_script
- jQuery not available to other scripts
- Using esc_url with a hard coded url
- Can´t access child theme´s scripts dependencies found in parent
- What is the safe way to print tracking code / pixel code before tag or tag
- Underscore Based Theme File Permissions in Git
- How to modify default controls in WordPress theme customizer
- How to enqueue javascript for WP Customize options sidebar?
- correct tags for validating input types
- Enqueued JavaScript is not working
- How to escape multiple attribute at once in WordPress?
- Overide enqueue in non plugable function via child theme
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- Contact Form Security
- How to fix : Uncaught ArgumentCountError: Too few arguments to function? [closed]
- How to enqueue a script which is type module without using script_loader_tag filter?
- Do I need to escape get_the_post_thumbnail function?
- Custom jquery not code not working in wordpress
- add jquery file if a certain page is included
- Adding google fonts to WordPress theme
- how can i remove js file from my footer in wordpress
- Strict Folder and File Permissions for WordPress Themes Folder
- hide theme files for admin beneath root
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Enqueue script for development purposes only?
- Correct was to customise theme using get_theme_mod in scripts
- how can I re-utilize and class on a child theme
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- enqueue script if page is not equal to
- Theme now uses require.js and enqueue script no longer works
- Enqueue script/style with multiple GET parameters
- Should we escape the values of constants?
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- How to add Color Picker in Theme Options for the following?
- Theme Review: post thumbnail, header image, content width
- How to determine if a category is empty?
- How wordpress handle upload images and how to use them in the code
- Change loop order via form or link (jquery, not URL)
- how to create theme based widget that can be drop in sider bar or footer
- CSS in child theme not overriding the parent theme [closed]
- How to test for MU via functions.php?
- List categories and exclude child categories
- Implement advanced search
- multisite: global menu containing network site links?
- Use second time navigation.js in underscores [closed]
- Add attachment for all images in post
- Overrite parent functions using child functions
- Include jQuery (or anything) inside Custom Options Panel’s tag
- WordPress 3 botches my Custom Meta Box values on Save
- Is there a WordPress boolean for “theme_customizer_active()”?
- Weirdness in jQuery supplied with WordPress
- Get Post’s Excerpt Without the Wrapping tags and the Read More link
- Navbar- disable “onClick” drop-down
- Injecting pre-defined text from custom page template to editor
- Using Foundation 5 off-canvas-menu with WordPress
- Parent/Child pages
- “The REST API did not process the context query parameter correctly.” Custom theme conflicting with Media Library
- Wrong activation/confirmation link in email
- How to enqueue scripts properly with ES6 webpack?
- Disabling wordpress added class
- PHP Script on a template page & dealing with URI’s
- Responsive Images with art direction
- Correct form of escaping and localization – functions.php breadcrumbs
- New created Theme leads to malfunctioning Xampp Apache –> functions.php is cause
- Where to find this broken link in order to remove it
- Woocommerce Theme Reviews / Comments
- background_image support multiple image size?
- Moving Posts and Users Only to New Site
- Want to display page content after password prompt without page reload
- Why do some sites show themes/”themename” as the only theme?
- How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?
- Bootstrap 4 mobile menu not working for WordPress Development
- How do I send out an update for my custom wordpress theme?