WordPress enqueues javascript before the HTML is rendered so WordPress doesn’t know what the class or ID is on the page.
What you MIGHT be able to do is deenqueue the Next-Gen gallery Javascript so it isn’t loaded at all and then create your own Javascript file which loads the required Next-Gen JS if a particular class or ID is found. have a look at the jQuery function getScript()
http://api.jquery.com/jquery.getscript/
Related Posts:
- Making a
- CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page
- What is the difference between the selectors “.class.class” and “.class .class”?
- How can I replace text with CSS?
- Bootstrap 4, How do I center-align a button?
- How do I horizontally center a span element inside a div
- Is background-color:none valid CSS?
- Text not wrapping inside a div element
- How to make padding:auto work in CSS?
- How to vertically center inside the parent element with CSS?
- CSS Outside Border
- CSS not working in Chrome
- Pure CSS to make font-size responsive based on dynamic amount of characters
- Adding border to CSS triangle [duplicate]
- How to enqueue style before style.css
- wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused
- Which Details Are Required For Style.css File Header?
- WordPress Register Style Called Incorrectly
- wp_enqueue_script + how to load JS or CSS in one URL merge call?
- How to target first img in every wordpress post with CSS [closed]
- hSite has no css on mobile [closed]
- How to dequeue styles coming from plugins?
- How to set different font family based on text language?
- Relative path in wp_register_style not working
- WordPress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files
- How to Add Custom CSS Buttons to WordPress as a Shortcode?
- How do I add an indicator to my .menu-item if it contains a .sub-menu?
- How do you customize the admin bar for buddypress?
- Load in wp admin assets from child theme
- Enqueue styles in new site editor in WordPress 5.9
- Header’s CSS doesn’t work in Chrome and Opera – any ideas how to fix it?
- Two column Dropdown for WordPress Toolbar
- Code working just in specific time period
- Images loaded as background-image are shown but s aren’t
- Moving button on Online Consulting theme
- Style WP_Debug?
- How can I get the search form to be selected automatically?
- Using transient for dynamic css , how to name it?
- Is there a way to add additional CSS styles to the styles css file dynamically?
- Is it safe to use WordPress generated classes?
- CSS styling of native (inbuilt) wordpress thumbnails [closed]
- Search Bar in Thesis WordPress Site
- Unstable handling of CSS under WordPress/Elementor
- Add core style in theme
- How to sync the style in the visual editor with the style of a child theme?
- How to change the settings of a video? [closed]
- Change text color dynamically in WordPress [closed]
- Add Custom Alignment Option to WordPress Blocks/Gutenberg
- Custom css author role
- WordPress aggressively caching CSS
- Font styling in embedded Twitter feed
- WordPress backend is loading as a list
- Embed widget from external source (Zendesk)
- Custom CSS in Widget editor (Gutenberg) gets stripped out
- Loading a stylesheet conditionally & verifying CSS
- Dequeue styles with query doesn’t work
- Dynamically populated scss values or how to change styles by user choice
- Save custom option in CSS file
- broken internal JavaScript and CSS files
- avada woocommerce product details in grid
- WordPress login using a completely custom page and no plugins?
- Modifications on css file are not visible
- How to display image on WordPress homepage
- My sites mobile view design is different when not logged in – how do I ensure it’s all the same?
- Trying to hide the contact form on a particular page
- Default Gutenberg CSS on frontend
- Two CSS files loading extremely slow
- Hide BBPress create topic on one page
- Dropdown contents hidden behind content [closed]
- How to adjust text’s width and put it at center of post (Visual) editor?
- different theme output for desktop and mobile
- Font size decreases when child theme is created from parent theme?
- Enqueue CSS and Script only if needeed
- Bootstrap News: Image Modifciation
- resize chat bar on mobile [closed]
- Menu reduce space between words
- add css to only body text
- Improving the readibility of bright text on a bright background [closed]
- Trying to remove white space between nav bar and content?
- Colouring the text on the video
- Specific text not affected by CSS style [closed]
- Import HTML code that loads css and javascript into specific page
- Padding added in sidebar, not coming from my style sheet [closed]
- Style Switching
- Adding a css style to the main nav menu in child pages
- Adding custom css to a theme depending on whether the admin user is logged in or not
- Adjusting post width according to the image size
- Theme looks ugly – FOUC – stylesheets loaded in footer
- Background tiles not working in iPad2 but ok everywhere else
- To override CSS of parent theme
- How to target only one element if more elements share the same CSS class
- Can’t override CSS with child theme
- remove white overlay [closed]
- Why doesn’t media(max-width) work on h2 title?
- How to use WordPress 3.8 back-end CSS in front-end?
- Enqueue MCE Editor CSS in admin page
- “Plate” theme broken after update
- adding additional css classes have no effect within block editor
- Busting Browser Cache when updating stylesheet of WordPress website
- adjust posts size into columns wordpress