• Resolved marcin32167

    (@marcin32167)


    Hi,

    Got lot of products on my page. How can i via code change Global in WP Swiper from bullts to fraction?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author digitalapps

    (@digitalapps)

    Hello, there is a slider type you can select, as fraction, let me know if that doesnt work for you.

    Thread Starter marcin32167

    (@marcin32167)

    hi, could you show me where?

    because i need to change it in all WP swiper widgets on all Pages globaly

    Plugin Author digitalapps

    (@digitalapps)

    i visited your page and looks like you have fractions on already

    Thread Starter marcin32167

    (@marcin32167)

    yes on that link sure but check the other one collections and there are still show bullets

    Thread Starter marcin32167

    (@marcin32167)

    i need i think maybe some code script change in all Pages where is added WP swiper block from bulkets to fractions

    Thread Starter marcin32167

    (@marcin32167)

    hi, again. I dont get any respons. Problem is still here? Let me ask you again how can i change it globaly?

    Plugin Author digitalapps

    (@digitalapps)

    sorry but i thought this is already resolved.

    you already got one slider working with fractions.

    Are you asking how to get the rest of the site’s sliders to match the settings of the slider that you have sshared with the link?

    if so, then this is not possible, you need to adjust settings for each block individually. This is by design.

    Thread Starter marcin32167

    (@marcin32167)

    Hi, Plugin Author! Of course, it is possible. Here is the code that changes the global pagination from bullets to fractions to all gutenberg block in all pages.

    add_action('wp_enqueue_scripts', function() {
    add_action('wp_footer', function() {
    ?>
    <script>
    document.addEventListener('DOMContentLoaded', function() {
    if (typeof Swiper !== 'undefined') {
    const originalSwiper = Swiper;
    window.Swiper = function (container, params) {
    if (!params) params = {};
    if (!params.pagination) params.pagination = {};

    params.pagination.type = 'fraction';
    params.pagination.el = params.pagination.el || container.querySelector('.swiper-pagination');

    return new originalSwiper(container, params);
    };
    Object.assign(window.Swiper, originalSwiper);
    }
    });
    </script>
    <?php
    });
    });
    • This reply was modified 11 months, 1 week ago by marcin32167.
    Plugin Author digitalapps

    (@digitalapps)

    This is a very cool solution , thanks for sharing!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Type of pagination – fraction’ is closed to new replies.