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?
- If necessary, how should wp_get_attachment_image() and its parameters be escaped?
- Theme Activate Hook
- Customize WordPress>Error Page
- Theme file for all pages that are a child of a specific page
- Strategy to get post meta for use outside the loop
- Authentication / login mechanism (non wp-admin)
- How to add a section to the menus configuration, offering hard coded items?
- Am I using get_posts wrong?
- Writing Clean WooCommerce Styles
- Modify Javascript Configuration Options for Theme Customizer Colour Picker
- How to get the URI to a theme without the domain. Example: /wp-content/themes/my-theme
- How to handle custom form submission?
- menu behavior is not as expected
- My custom theme does not load the translations
- A mystery 300px image size
- Custom Field returning Numerical Value for Image rather than URL
- which is the best way to customize nav-menu-template.php?
- wp-cli: For development, how can I activate a theme that is on the local disk but not zipped?
- Why is the Page Template dropdown menu using the wrong file name?
- 2 localizations inside a WordPress theme
- Custom theme updater – random string in new theme name
- [&hellip appearing instead of […]
- Replace single_template filter with what for default posts?
- Is there Photo Categories?
- WordPress does not load page template or anything else, just empty page with header and footer
- add shortcode support in customizer
- How to make my themes compatible with different WordPress versions?
- Exclude subcategory from wp_query
- Custom search template is showing 404 when adding query string
- How do I restructure the comment HTML layout?
- Let user publish posts on community page
- How to perform str_replace on the results of wp_list_pages
- How would I get this to work – send to post from thick box
- Safe way to echo wp_trim_words
- Show category and description
- How can I demonstrate themes well?
- trying to figure out how to use more that one image upload in the same section in theme customizer
- WordPress custom jquery not found
- How to using custom DB tables
- Replacing static code in a template file with a sidebar and widgets?
- Theme’s featured image option is not showing up