You can use conditional tag such as is_page(). Register your script on hook wp_enqueue_scripts
and enqueue it in if statement :
wp_register_script('myashdrop',
get_template_directory_uri() . '/js/dropdown.jquery.min.js',
array('jquery'));
if (is_page(PAGEID)) { wp_enqueue_script('myashdrop'); }
Related Posts:
- Why use if function_exists?
- get php variable from functions php and echo it in theme template files [closed]
- Use AJAX in shortcode
- Include files in child theme functions file
- WordPress function like is_category for subcategory? is_subcategory?
- WordPress Theme Update Action?
- How to get woocommerce inventory status [closed]
- Auto close (hide) custom metabox / set default state
- Does WordPress Development Mode Exist (with not minified JS)?
- WP_Query in functions.php
- Implementing DNS Prefetching with WordPress
- wp_delete_user with username
- what is the meaning of settings_fields()
- Organize functions.php
- Why do I get Fatal error: Call to undefined function get_most_recent_post_of_user()?
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- Edit the_content function
- write in functions.php
- How to set child post categories to parent post categories when updating parent post?
- get excerpt without images
- display 100 products per page on product category page [closed]
- Advice: Template structure – php blocks in sidebar or someting else?
- Help to resolve Syntax error, unexpected ‘endwhile’ (T_ENDWHILE) [closed]
- Checked() showing up twice in custom fields
- Removing the first image in content
- Gravity Forms field entries into wp_query loop [closed]
- Global functions on WPMU
- Remove the deleted users avatar from list
- Update Content based on expiration time or queued processing
- is_account_page() change to page slug
- Adding to fontawesome-webfont.woff2 to boost website speed
- How to enable template page only for a post id page
- Help with WP gallery function, wrap gallery in div
- set_post_thumbnail when user is not logged in
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Remove after images
- Get First Child Page ID or Permalink in WordPress Admin
- Footer disappears when using the_content ( )
- Passing User_Fields to Contact form 7 [duplicate]
- How can this crude function be improved?
- How to override woocommerce.css?
- Connecting to a 2nd DB gives me no results when querying
- Including php files within template
- Author Date Function not working as expected [duplicate]
- Add_filter when value is no variable?
- The Loop not looping?
- wp_star_rating() – Adding a 5 star rating system to theme
- How to hide image-url if no attachment?
- New custom menu created. how to apply it?
- Use Composer Package inside class – Namespacing error
- How to properly refresh page after form action?
- Default Nav Highlight
- Update to functions.php not showing in dashboard
- Unable to point the child theme directory even using get_stylesheet_directory()
- Change WooCommerce add_to_cart Button Text?
- WordPress Website with Login system
- Return link pages instead of displaying them
- Adding Read More to Custom excerpts
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- Get the alphabetical sorted data with wpdb
- WordPress Check User Role Function (multiple roles)?
- Add a custom function to widget code
- Create Custom URL structure for specific Post category using Post ID instead of post name
- Add custom taxonomy using JS in post editor
- WordPress: Highlight search result exact matches
- wp_set_object_term via js btn frontend
- How can I show a specific page to admins only?
- Adding custom social icons to the social media icon block in the Gutenberg editor?
- Allow user select role in wordpress default registration without plugin
- Display link to category over featured image
- Hide author info in single posts by certain users
- Creating a custom functions page wordpress
- search and replace using regex
- post value to function with Ajax and jQuery
- Re-style Login Form Whilst Keeping CSS Separate from Frontend CSS
- (Divi): How to make WordPress load images of specific size for Blurb modules on given page with a funciton?
- Strip all HTML tags from product content and resave
- Calling hooks in functions
- WordPress Toggle Menu has stopped working
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- Shortcode with pagination advancing multiple queries
- How to add custom column into custom post, when field is select
- Author Page User id in functions.php for non login user
- How to add widget in main menu
- Function image_send_to_editor returns emty title tag
- Integrate WP Tiles into existing loop (index.php) and theme
- Show the post date using the wp_get_archives() function?
- Why does my visual post editor break when I try to add a TinyMCE button?
- Show latest custom post types on dashboard
- Using conditionals, maybe from a DB, to register & enqueue files, for varying pages, in functions.php
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Adding a filter to my posts
- Why don’t some template tags work when querying information on single.php?
- Problem with Child-Theme using of foundation-framework [closed]
- replacing words to “…” [closed]
- Directing to functions.php the correct way
- Working function() doesn’t execute when triggered by WP CRON
- WordPress – Notice: Function wp_enqueue_script was called incorrectly
- post_row_actions filter from parent theme not executing in child theme