• Hi Daniel,

    Great job on this plugin.

    I’m trying to build an index of categories for my website. Users can click on any specific letter and they will be taken to a page with the list of categories starting with the letter.
    I’m new to WordPress, but I’ve tried [a-z-listing display=”terms” taxonomy=”category” alphabet=”Aa”]. This shows all the categories, not a list of categories starting with the letter “A”.

    Is there an easier way to achieve this?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    My plugin doesn’t support this quite how you want it. I have supplied a small javascript file that, when loaded, will “hide” some of the list so that only a single letter is showing at a time. However, this is done entirely in the browser so you won’t have a separate page for each letter.

    You can experiment with this to see if it suits you with the following code added to your theme’s functions.php file:

    add_filter( 'a_z_listing_tabify', '__return_true' );
    

    The script uses jQuery-UI’s “tabs” functionality to implement the feature.

    Thread Starter chordzone

    (@chordzone)

    Hi Daniel,

    I’m not seeing the js file that you’ve supplied. Or is there some other way that I have to get the js file?

    Plugin Author Dani Llewellyn

    (@diddledani)

    The file is at wp-content/plugins/a-z-listing/scripts/a-z-listing-tabs.js. The code I posted above should be sufficient to cause it to be loaded.

    Thread Starter chordzone

    (@chordzone)

    Thanks a lot. I’ve tried it out. It works great. It’s currently showing only categories starting with “a”. Is there an option to set the letter instead of “a”. That way I would be able to create it on different pages with different letters.

    Plugin Author Dani Llewellyn

    (@diddledani)

    You can link to a specific letter by appending #letter-a, #letter-b, #letter-c, etc to the address of the page: https://example.com/a-z-listing#letter-a. Note that this is entirely handled in the browser – everything after a # in a web address is only ever seen by the browser, and never sent to the server. That means while it appears to be different pages it is actually all the same page with different bits hidden and shown on-demand.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Only show Categories starting with specific letter’ is closed to new replies.