So I’ve solved the issue by looping through all of the items by class and indexing them with a data attribute.
$( '.tiled-gallery').each(function(){
var i = 0;
$(this).find('.tiled-gallery-item').each(function(){
$(this).attr( 'data-index', i );
i++;
})
})
Related Posts:
- Add Lightbox To WordPress Native Gallery
- Filter specific shortcode output?
- add_filter and changing output captions of image gallery
- How to add attribute to output with wp_video_shortcode add_filter
- Change default settings used by gallery shortcode
- Ajax, filters and shortcodes
- Removing labels and tag on WordPress’s default login form
- Error when overriding only some audio shortcode HTML output
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- How to filter backend post list showing only posts having a shortcode
- Need to return shortcode text instead of the output
- Set default value for “Additional CSS class(es)” for specific block types
- Is it possible to bind a function to a filter hook via Ajax?
- get_post() containing gallery is outputting an unmatched closing div at the end of the content
- the_excerpt filter doesn’t work as expected
- Disadvantage of using filters & hooks multiple times
- WordPress add script with custom type (x-jquery-tmpl)
- How do I hook my function to run only after submitting login form
- run shortcode in excerpt of single custom post type
- Filter everything from content except output of a shortcode
- Admin post list – adding an option to the date filter dropdown
- Modify message displayed on post save
- Something is filtering my shortcodes… Can’t figure out what
- How to add a filter to the get_body_class function?
- Prepending character(s) to a custom tag title?
- Change custom post type GUID in RSS
- Nested Gallery Shortcode INTERMITTENTLY working
- Pass debug_backtrace() in WordPress filter
- filter hook to load a different post/page on current post/page
- Modify existing plugin function with add_filter
- How to override include_once pointed file using add_filter?
- Is it possible to add a shortcode below post title?
- How to use do_shortcode_tag to modify the output of a shortcode?
- Shortcodes within the sidebar text/html widget: How to preserve the raw HTML output of the shortcode?
- How to change dynamically page title according to variable data?
- Remove actions/filters that are set with create_function()
- Native gallery custom html output
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- How can I filter tag_description()?
- WordPress removing slashes from shortcode output
- Remove tags without a specific meta key from “choose from the most used tags”
- Redirect to woocommerce checkout after adding to cart – item already in cart
- comment_for() Custom fields not visible when user is logged in
- How to access page variable inside action hook
- What is the action hook to use if you want to capture the new password during password change?
- Get_template_part inside filter?
- I need to hook and change language of facebook sdk
- Use has_filter on comment_post
- How can I edit comment meta value before it is saved?
- How To Get Search Term and Use in Function
- custom gallery filter with image caption as link title?
- How to remove shortcode(s) from WYSIWYG Page editor for Non Admins
- Renaming wordpress login and get new password button
- Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )
- Gallery stripped from excerpt of post
- Hook in a sidebar widget and add some markup
- an action hook when a post reaches a certain number of views
- Shortcode / plugin with custom (flexible) output
- Filter Shortcodes when using get_page
- Action hook to control access to certain parts of my site
- Parse a shortcode differently based on on what it’s nested in
- add_filter to the_content after apply_filters
- Where exactly does the edit_{taxonomy} hook fire?
- BuddyPress – A hook available to hide custom born date on public profile view?
- Is there any reason for the nested filters to be applied on the first case and not in the second one?
- Same URL for portfolio and for a page creates 404 error. Is there any filter that i can use for a child page?
- Replace Data In Post & Update Meta Field Post Is Saved
- post_orderby filter breaks function
- Filter Media by attached page or blog post in Library
- ‘manage_users_custom_column’ is a filter, but ‘manage_posts_custom_column’ is an action. Why?
- How do I add a line break to a string that is output by PHP?
- Scanning for custom embed and prefetching
- The gettext hook doesnt work on text with links
- Filter widget_posts_args not working
- How to add custom media library mime icons?
- Hooked into wp_get_attachment_caption to add content to the default description; not working for jetpack slideshow. Why?
- the_content getting current page content instead specified ID
- Filter the title to only affect the_title() template function
- Remove and replace woocommerce add to cart button [closed]
- style_loader_tag not changing stylesheet to preload
- How can I filter the comment action links so that I can display the actions links based on user capabilities?
- Hook to change the site URL
- “The editor has encountered an unexpected error” After add defer tag to java script
- Modify WordPress Page Title ()
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- how to unescape wordpress output
- Override wordpress audio playlist
- Hook to add content after date in post?
- Is it possible to assign a css id to a row in plugins list table?
- Right filter for rewriting page statuscode
- Add filter return false not working
- How to wrap pattern-matches from the_content in [wiki]-shortcode tags
- create a shortcode with acf including a filter
- Remove image of srcset
- How to take shortcode and content separately from a page?
- Re-order search results with posts_orderby filter and post meta value
- Security question – Display a General Custom Login Error Message
- How to stop echoing gallery inside content?
- Filter wp_mail based on content type