Make sure that the javascript loaded by your load-scripts.php is waiting for the document to finish loading before attaching all of the listeners.
When you created a separate function the code ran only a tiny bit earlier, but it was probably early enough for the elements to finish loading and the listeners to properly attach.
Related Posts:
- Gallery IDS and Captions: hide/show on a per ID basis
- Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- How to get shortcode working from custom meta field
- Automatically add this attribute to the gallery shortcode
- Multiple content areas per page
- Gallery Shortcode: using link attribute to link to a specific image size
- Remove width and height attributes from [gallery] output
- Looking to display non-image files in Gallery with logo specific to file type
- Print shortcode in custom action hook not where the shortcode is entered
- shortcodes – style them or change/remove the square brackets?
- Customize the WordPress Default Gallery Output
- Best way to implement a thumbnail-based gallery in WordPress?
- Modify Gallery Output to render differently on a PAGE and a POST
- Get ORIGINAL image links from get_post_gallery
- Creating a shortcode by pulling in a custom field from a plugin
- Duplicated content with custom shortcode
- wordpress shortcode not working
- Where to upload my new custom ShortCode in Separate .php file?
- Customizing the gallery of the post correctly
- Personalized Gallery what are my options?
- Custom default settings for WP native Gallery Block
- Display Custom Taxonomy Name As A Shortcode
- Lightbox not showing image caption
- wp.blocks.registerBlockType not showing what I want on the frontend
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- Local Shortcode Using WordPress Custom Fields
- Changing ‘Add to cart’ button text and relink for some specific products [closed]
- Replace custom gallery shortcode with default gallery shortcode
- ACF Shortcode bringing in my shortcode is adding unnecessary line breaks
- Remove width and height attributes from [gallery] output
- How to support extra color options for shortcodes?
- How to customize the gallery shortcode in WordPress?
- Gallery Pagination by Row
- How to create a shortcode with HTML code in it and custom parameters/
- Conditionally Loading JavaScript/CSS for Shortcodes
- What is the best way to customise admin files so they survive future upgrades?
- Creating my own Admin Forms in a WordPress CMS?
- Add control in image detail panel
- using upload image with media_handle_upload .. but !
- No option to add a ‘featured image’ in my wordpress installation
- How-to inspect filter-able $vars?
- pagination in woocommerce order history page
- Combine multiple words in custom meta search query
- conditional shortcode not working
- How to run a test WordPressMu to WordPress3 update?
- Comparing two WordPress installations
- WordPress development using Docker – how to share directories? [closed]
- How do I copy all “extra” data (menus, widgets, etc) from one theme to another?
- How to add more than one RSS Feed Link for wordpress
- How to link external JavaScript files?
- How to create a list of items with fields in WordPress?
- Create default_content layout template based on post id
- Remove ability to Permanently delete an image from the Media Library
- Filter posts by custom taxonomy terms
- want to create a subcategory.php to manage subcats
- Updates for a private theme
- Hi, I wanted to make custom search with multiple fields
- Contact From 7 Custom Validation Issues
- How to add an extra button on woocommerce shop page and use it to send the product info with image in a mail? [closed]
- Calling an attribute from a plugin shortcode
- education system [closed]
- Search widget will search everything in the site, how to limit to only search gallery name
- custom post type – page template
- Order posts with a custom field but also without
- How to hook up search results page to a back-end page?
- A truely custom login page?
- Widgets won’t save
- Use a shortcode to display custom meta box contents
- Add the site’s name as prefix when adding new users? Multisite
- How do I create a root link in wordpress to a PDF file?
- Centering one product on a single page [closed]
- Remove link from page title
- Which delete query is better with prepare or delete
- How to add page content into another page
- Localhost wordpress access remote db wordpress website
- add_action does not work when instance multiple tab-containers via template-file
- Display Images with More Fields yes / no
- accessing monthly archive from dashboard
- WordPress 3.1.2 Bug: add_theme_support() and video post format registering twice
- WordPress 3.1 update has reversed my blog posts
- Different profile page by role
- Changing update message from Newspaper child theme
- Best practice to generate token for email action
- how to change the url rediction of the woocommerce login page of the flatsome theme for my own in wordpress?
- Can’t do a src to node modules folder
- Custom roles and capabilities media not work right
- How to customize WordPress vertical menu?
- Query Posts to display all posts with category “custom field value”
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Custom WP deactivate an email activation link sent to user’s email.
- restrict access to specific urls on a specific period of time
- How to setup a taxonomy that can have only one post assigned to it?
- Changing layout of defaul gallery output to masonry
- Page template with custom html fields inside a content
- Custom Style per Post, How to Display Custom-Styled Single post on Homepage?
- How to move menu next to left of the search box?
- how to manage Session in WordPress using custom login?
- Add custom information in editor summary
- A Voting system for a pageants