Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Add CTA Button to JKIT Gallery widget */
- function add_cta_button_to_jkit_gallery() {
- ?>
- <script id="add-cta-button-to-jkit-gallery">
- (function ($) {
- var $widget = $('.jeg-elementor-kit.jkit-gallery'),
- $item = $widget.find('.gallery-item-wrap');
- $item.each(function (index) {
- var buttonLink = $(this).find('.gallery-link[data-elementor-open-lightbox="no"]').attr('href'),
- buttonTemplate = `<div class="button-wrapper"><a href="${buttonLink}">Get Sample</a></div>`;
- $(this).find('.item-caption-over').append(buttonTemplate);
- })
- })(jQuery)
- </script>
- <?php
- }
- add_action( 'wp_footer', 'add_cta_button_to_jkit_gallery' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement