WordPress.org

Forums

Simple Links
[resolved] A-Z index (4 posts)

  1. eric.hoegee
    Member
    Posted 1 year ago #

    Hi Mat,

    I use your plugin on my site and so far so good. It does it's work.

    We use it on http://www.mimallz.com/stores. As you can see it makes a very long page with just links. We don't really like that it is becoming so large. So we want to restyle that page to make it look and work better. We are going to substitute all text for images (logo's).

    Is there a possibility that I can create a A-Z menu at the top of the page. So, if the user clicks "A" he will only get to see the links which start with the letter "A".

    I know this is custom work and probably a lot but i hope you could point me in a direction and/or give me some advice.

    Hope you can help me out!

    http://wordpress.org/plugins/simple-links/

  2. eric.hoegee
    Member
    Posted 1 year ago #

    I thought to do it like this but realize it is a n00b approach:

    - I create category A to Z.
    - Give every link it's corresponding "letter" category.
    - I create a page for every letter.
    - Paste a shortcode for that category on each page.

    Must be a better way to accomplish this, right? :)

  3. eric.hoegee
    Member
    Posted 1 year ago #

    Ok, i tried this now and works. (http://www.mimallz.com/a-z/a)

    I just realized i made a terrible thinking error, we have the sidebar with my categories and that needs to stay. The a-z menu i just made only works over ALL the links. What i need is when i click the left-sidebar:

    Women -> Fashion -> Shoes

    That i can use the a-z menu to filter that results.

    Is this at all possible?

  4. Mat Lipe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Eric,

    You could add this to your themes functions.php file:

    add_filter('simple_links_list_item', 'simpleLinksByLetter', 99, 2);
    function simpleLinksByLetter($out, $link){
        if( !isset( $_REQUEST['letter'] ) ) return $out;
    
        if( !strcasecmp(substr($link->post_title,0,1), $_REQUEST['letter']) ) return $out;
    
        return false;
    }

    With that in place all you will have to do is add a ?letter=a or ?letter=b etc to your links

    For example http://www.mimallz.com/stores/fashion/women/shoes/?letter=b would show all the links on that page which start with the letter b only.

    Hope this helps!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Links
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic