• zack1234

    (@zack1234)


    Hi.I nice plugin.but it’s only show my woocommerce categories after clicking on letters.I want them visible like on your plugin’s screenshot.Is it possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey,

    Firstly you should find plugin theme file.
    /plugins/a-z-listing/templates/a-z-listing.php

    There are everything in there. You can do many ways like JavaScript or PHP with if / else method.

    Plugin Author Dani Llewellyn

    (@diddledani)

    The plugin doesn’t provide any way to display only partial listings. You can potentially modify the template, or use javascript to hide the “other” letters. Perhaps some javascript like this will work, though it’s untested?

    function hide_azlisting_sections() {
        if ( typeof window.location.hash !== "undefined" ) {
            const elements = document.getElementsByClassName( 'letter-section' );
            for ( const element of elements ) {
                element.style.display = 'none';
            }
    
            const active_letter = document.getElementById( window.location.hash.substring( 1 ) );
            active_letter.style.display = 'initial';
        }
    }
    
    if (document.readyState === "loading") {
        document.addEventListener( 'DOMContentLoaded', hide_azlisting_sections);
    } else {
        hide_azlisting_sections();
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘listing only show after clicking on letter’ is closed to new replies.