Usually scripts and styles are loaded with wp_enqueue_script or wp_enqueue_style in the theme’s functions.php. That’s the most common scenario.
This function takes an $src parameter which is the absolute URL to the resource, and the best practice is to use get_stylesheet_directory_uri to retrieve the URL to the folder containing the script. This way, if the site is moved, the URL will change with it.
It might be that those were hardcoded strings. That’s why they’re still the old ones.
See examples below
https://developer.wordpress.org/reference/functions/wp_enqueue_script/#user-contributed-notes
Scripts and styles loaded from a plugin should use plugins_url in the $src parameter.
wp_enqueue_style( 'prm_style', plugins_url('/assets/style.css', __FILE__ ) );
Related Posts:
- Tips for using WordPress as a CMS? [closed]
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- What are the package and subpackage comment for?
- Experiences with adding Nonces to the comment form
- How to get the active theme’s slug?
- How to add plugins to wordpress theme?
- Disable author pages for specific users
- Set active theme via URL
- How do I make my wordpress page more friendly for mobile viewers?
- Check javascript file Proper way in functions.php
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- dequeue not work
- Recommendations for books/resource to get started with wordpress 3 development (plugins/themes) [closed]
- Uncaught Error: Call to undefined function get_user_by() after moving function from theme to plugin
- Translating plugin inside the theme [closed]
- How to Implement “Notice: This theme recommands the following plugin:xyz” in wordpress? [closed]
- Change settings of get_post_type_object
- Sage WordPress – Plugin Namespace: Not Found
- Unable to install theme recommended plugins on Multisite
- More than one text-domain is being used because of the included templates for plugins
- Different UI in WordPress
- plugin style conflicts, how to override? [closed]
- Hooking in to replace the Sidebar/Widget areas
- There is any way to remove post-format filter? [closed]
- Child Pages Short Code plug-in and hover capabilities?
- WordPress site periodically goes down
- Masonry images not working
- Why namespaces are rarely used in WordPress plugins?
- (Big issue) Blog is Getting Down Each day.. what should i do.?
- How to require users to login when not logged in
- Is there any hook for theme activation ? or something similar?
- “No Add Button” for me to customize my WordPress with themes and pluggins
- How can I list all installed plugins/themes/versions from CLI/API?
- Why does my file_exist check fail?
- How to protect WordPress from security scanner [closed]
- how can I query all wordpress users of a blog
- Is it possible not to load theme on a specific page in wordpress?
- I receive taxonomy id
- Theme My Login Shortcode Doesn’t Return Anything
- Include Minit plugin in theme [closed]
- How to extract a .wp-env.json or composer.json containing plugin versions from a production website?
- Moving FB comments at the end of page
- How to include files relative to a file’s directory
- How Do I Uninstall a Current WordPress Theme and Install a Fresh Theme
- What is it and from where it is loaded?
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Blocking Plugin Css to load custom in template directory
- Load CSS files in header of Bones theme?
- How to handle a WordPress blog with articles in different languages?
- display unique post per category
- How to display a widget on a page with no theme?
- navigation among single posts
- After a manual update, themes and plugins that were installed (and still in the directory) are not being seen
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- WordPress Cache delete on plugin uninstall
- Unknown theme modal source
- How to override any plugin file in the child theme
- Replace old theme that understand old css (vcex_icon_box css_animation)
- WordPress website will not show menu on a Mobile Device
- Mobile Menu and Mobile Sidebar missing
- Ensure WordPress Theme Uninstalls Completely
- custom fields not displaying on wordpress site
- Ajax Call not Working in Plugin
- Different theme menu
- Bash script to check available updates
- WordPress fresh installation did not update default plugin and themes to latest version
- How to store a custom theme and update it on other installations
- How to get a post views count using ‘WordPress popular posts’ plugin
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- How to prevent redoing get_posts queries and make results available to other scripts?
- Is it possible to disable a theme programmatically?
- Google trying to index child theme files
- WordPress panel is not loading after plugin activated with error: HTTP ERROR 500
- Cron job emails blank
- In the WordPress API is there a way to set the width of the post/page container
- How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
- wp_login_form() ignoring login_form action hook
- What Are the Advantages of Using an mu-plugin
- How to fix On “An unexpected error occurred” message when I click on Add new theme or plugin?
- How to display post by date written (1974) and not date published (today)?
- Things that saved lose when logout
- Images is not showing after migration
- Child Theme Changes Are Not Reflecting In Parent Theme
- Automatic updates of plugins and themes outside of wordpress.org
- Input gets deleted/overwritten after changing to different Admin Menu
- Theme specific plugin, how?
- Run WP inside a other Site without using frames
- Breadcrumb is not generating the correct post page url
- Display static pages instead of category, in code
- Theme causing SSL break on chrome
- Why does theme need woocommerce to show images / content on front page?
- Install theme as part of a plugin
- Divi Template A Few Questions
- Trying to use wp_register_script/style and enqueu them from an array – getting an error [duplicate]
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Am having issues intergrating this api into my wordpress site, any help please?
- How to add links to different language versions of WordPress
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)