Simple Links
[resolved] Order links by parent child relationship within category (5 posts)

  1. fionaw
    Posted 3 years ago #

    Is it possible to order links by parent/child relationship within a category?

    I need to create an alphabetical list of links, but some of them have child links which need to appear beneath them. Something like this:
    A company link
    B company link
    - child link of B company
    C company link

    I'm using the shortcode to orderby="title"

    I can see that I could do this manually with 'link ordering', but with a great long list to manage I don't think that's practical.

    many thanks,


  2. Mat Lipe
    Plugin Author

    Posted 3 years ago #

    Hi fionaw,

    There is currently no way to do this which is built in to the plugin.

    There are filters you may use to recorder them and change the display.

    See http://lipeimagination.info/simple-links-docs/ for more information

  3. fionaw
    Posted 3 years ago #

    Hi Mat,

    Thank you for such a quick reply.

    Sorry, I had stared at the documentation, but failed to spot that. So, I need to use the simple_links_shortcode_links_object ?

    Unfortunately, I don't know where to start! If you could give me any pointers I would really appreciate it. But if that is above and beyond then I'll have to rethink how I do this.

    I love the plugin!

    many thanks,

  4. Mat Lipe
    Plugin Author

    Posted 3 years ago #

    Hi Fiona,

    The filter you will most likely want to work with is 'simple_links_shortcode_output'

    The second argument will be the raw object of links which may then be ordered at will.

    There is also a little known method which may be access like so simple_links::linkFactory($link_id)

    Once you order the links how you want you may loop through them and by sending the link_id to the factory method for each link, the output will be created for you.

    I realized this will take some advanced coding to accomplish. Sorry I can't be more help, I'm currently swamped getting ready for WordCamp San Francisco.

    Hope this helps

  5. fionaw
    Posted 3 years ago #

    Hi Mat,

    Thanks again for such a quick reply.

    I will certainly have a go!

    Enjoy San Francisco!
    best wishes,

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic