As stated on WP Devel, you should always use the appropriate hooks. Else no child theme could deregister the script later.
// In your functions.php file
function add_suggest_script()
{
wp_enqueue_script( 'suggest', get_bloginfo('wpurl').'/wp-includes/js/jquery/suggest.js', array(), '', true );
}
add_action( 'wp_enqueue_scripts', 'add_suggest_script' );
This will load the script from the includes folder and stick in your footer (where a script ideally should be).
You could also use includes_url()
in the function above. This will also check for SSL connections.
Note: You’ll have to have wp_head();
present. Inside there the mentioned hook gets fired.
Related Posts:
- ajaxurl not defined on front end
- How to include jQuery and JavaScript files correctly?
- jQuery in header or footer
- How to avoid loading same script twice?
- WP Plugin Running before jQuery
- Using function from enqueued .js file in theme in plugin?
- framework for plugin/theme options panel? [closed]
- Single functions.php or split into many small files?
- How can I configure Docker for developing and deploying a custom theme?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Load js/css files only on specific admin UI pages
- Get list of scripts / styles and show file which enqueued them
- What is the difference between esc_html and wp_filter_nohtml_kses?
- How do I conditionally enqueue script for CPT single post type with plugin?
- Escaping built-in WP function return strings
- Having Problem On Getting WP Post Gallery Images URL
- What’s the difference between hooks, filters and actions? [duplicate]
- Customizer Not Saving Options
- How to bundle a plugin with a theme, or vice versa
- Script won’t load via plugin class
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- What function to hook for changes made in status and visibility of a post
- Example of uninstaller routine to remove all custom theme options from wp_options
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Best choice of options/settings framework for plugin/theme development
- How to determine if the current file is loaded in a plugin or in a theme?
- Filter, or any way to dynamically change theme screenshot image?
- WP_Query returns no results
- Should action callbacks start with a verb?
- Display content from custom post without modifying the single template
- WordPress not working on localhost
- Enqueue scripts in footer
- Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?
- Can I change header.php of current theme through a plugin function?
- Creating a Link Text like Submit Button in Admin Page
- Beginner advice
- How to render a time-of-day string like ’16:42′ with a site’s chosen time format?
- Are block templates incompatible with serialize_blocks?
- SQL query for custom taxonomy slugs
- conditionally load javascript & CSS for do_action() calls from plugin
- WP Gutenberg Blocks – How to limit first/root blocks
- Form doesnt save to database
- Notice: Trying to get property ‘term_id’ of non-object
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How do I create plugin or theme using MVC pattern?
- How to Get Current Custom Post Type Associated Taxonomy Term
- Selectively update themes in WordPress multisite
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Template directory in plugin
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- should i be checking for jquery before enqueing it in a plugin
- Custom Plugin – CSS works, JS doesn’t
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- How to add plugin options in wp editor page
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Create fixed static pages
- Save temporary registration data
- Enqueue scripts inside a class in a plugin
- Enqueue ONLY Plugin Styles and Scripts
- WordPress Plugin Authoring question about jquery and css
- Setting a post’s category
- Why my theme’s css not working on another site
- How to show comments from different Plugins to same post type?
- Add default value from selection
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Override category archive page title (not the head title)
- Metabox types list
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- Append php file to footer
- AJAX call of function containing javascript which is not loaded (Plugin development)
- How do I make two shortcode use the same id and increment it when I use them multiple times?
- Post Pagination does not working on WP-Query
- How to CRUD from wordpress database in wordpress theme?
- Dynamic sidebar areas not working on the Theme Customizer
- Caption Shortcode: what filter to change the image size?
- Font Awesome stopped showing icons, shows &# text instead [closed]
- Merge Codes using redux framework
- Managing Custom Designed Content
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- variable created in page.php is null inside of header.php
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Updating Style From WP Options Setting Page
- WordPress Beginer to Guru [duplicate]
- Enqueue Script in custom plugin before other
- append code after the_content not working
- Problem with Poedit [closed]
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Invalid Menu Items
- How react js and other Javascript Technologies works on WordPress plugin?
- Remove Gutenberg Buttons Block