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/
- accessing monthly archive from dashboard
- Exclude current post but keep the same posts-per_page amount
- WordPress 3.1.2 Bug: add_theme_support() and video post format registering twice
- Display a specified content on a Page and all its child pages
- Create new network instance, import old single installs AND keep the urls?
- title tag function
- How to do multi site setup
- Making jQuery-based galleries with WordPress without a plugin?
- WordPress 3.1 update has reversed my blog posts
- WordPress Command Question
- getting a 404 page for all pages except home. possibly permalinks
- Different profile page by role
- kitchen sink not working
- how to stop a gallery slideshow
- WordPress menu: How to make www.link.com/#name never contain current_page_item class?
- Troubles about insering a POST with a SQL query, post_status
- Any Good WordPress Client Like Live Writer To Create Static Pages
- WordPress homepage hangs in IE browsers
- WordPress pagination with custom post type?
- How to retain visual breadcrumbs w/ tricky URL structure? Custom post template?
- 2.9 to 3.0: Pros and cons of upgrading?
- How do I create a Custom Post Box that Connects Different Posts Together
- How to replace blog page url with subdomain at all places, even in xml sitemap?
- Pull Latest Forum Posts within WordPress
- How to setup a membership system in WordPress?
- Where’s did this div element come from?
- query_posts meta_key with current date
- How to activate flash cards
- Add array of post id’s to a category?
- Transferring theme and imported post attachments
- Adding pub_Date to an RSS feed hosted on WordPress
- Get custom field value from not-current page
- Mimicking admin panel menu from wordpress 3.0.1
- RSS feed showing deleted post
- saving the widgets position after drag and drop
- Custom page template, not acting as page
- Google calendar in wordpress showing events
- How can I resolve a .htaccess internal server error setting up a WordPress multisite?
- Trying to use .htaccess to redirect /profile to /login-2?action=profile
- how or where wordress collect unlogged user session
- How to create social Share Buttons Without Plugin
- Customize Widget Navigation
- Is it possible to add custom badges to product attributes conditionally, based on custom field?
- wp_enqueue_script JS code runs too late (after user begins interacting)
- Created Custom Block – When I come back to edit post/page and change my block content – Update button stays disabled
- Hook before user is created and make some custom validation
- I found this code to be very useful, how can I change it to a text that display “Product versions and period of last update” rather than a button?
- How do I make Dynamic Student Admission Form?
- WP Search Form Query: Add Author’s posts into search query
- Prevent WordPress from automatically installing a new theme each year
- Dynamic Sections
- Creating a “Delete”-Button for Metadata userspecific
- Change default Video Player without Plugin
- Changing update message from Newspaper child theme
- Add custom border across footer widget area
- Make the home page template my archive/category page template without code duplication
- Don’t update modify time post on Quick Edit
- Is it possible to auto sharing post on social network from specifc categories or tags
- How to show parent taxonomy using get_the_terms?
- wp_insert_post custom taxonomy multiple Category not added
- Custom menu not showing even though it shows as being registered?
- Open login logo URL in new tab
- Get custom text if in Category
- How to change the login page without a plugin and not only customizing logo and text around the form?
- Conditional Logic on CF7 dropdown options