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?
- Selective styles and scripts inclusion
- How to Use Webpack with WordPress Script Modules and Enqueue a Custom Class
- If necessary, how should wp_get_attachment_image() and its parameters be escaped?
- How to assess whether a WP core (or other) function is escaped already or not?
- Menu items description? Custom Walker for wp_nav_menu()
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- When to use is_home() vs is_front_page()?
- What is the preferred way to add custom javascript files to the site?
- Get the blog page URL set in Options
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- ajaxurl not defined on front end
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the constant WP_USE_THEMES for?
- How Do I Protect My Premium WordPress App Theme from Copying?
- How to detect mobile devices and present them a specific theme?
- Using wp_add_inline_style without a stylesheet
- How to add posts to custom menus?
- WordPress Theme Preview Image
- How To extend WP_Customize_Control
- What is the difference between front-page.php and home.php? [duplicate]
- How can I get page slug
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- When to use _e and __ for the translation?
- What is a Theme textdomain?
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- CSS not updating in browser when I change it
- Display Search Result Count
- wp_nav_menu(), how to change class?
- theme path in javascript file
- Is wp_is_mobile() effective?
- Display Menu Name using wp_nav_menu
- Making update notification functionality for my themes
- What questions do you ask when asked to give an estimate on theme development?
- How to remove dashicons.min.css from frontend?
- How do I remove a pre-existing customizer setting?