• Resolved fionaw

    (@fionaw)


    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,
    Fiona

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mat Lipe

    (@mat-lipe)

    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

    Thread Starter fionaw

    (@fionaw)

    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,
    Fiona

    Plugin Author Mat Lipe

    (@mat-lipe)

    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

    Thread Starter fionaw

    (@fionaw)

    Hi Mat,

    Thanks again for such a quick reply.

    I will certainly have a go!

    Enjoy San Francisco!
    best wishes,
    Fiona

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Order links by parent child relationship within category’ is closed to new replies.