WordPress.org

Ready to get started?Download WordPress

Forums

displaying 'get_links' in order of addition (10 posts)

  1. syrupcore
    Member
    Posted 9 years ago #

    Hi WP-land,

    I have a small links section at the top of my page. a sort of 'new news links from other sites'. I'm listing it with this code:

    <?php get_links(2, '<li>', '</span></li>', '<br /><span>', true, '_updated', true, false, 3, true); ?>

    for some reason it's not sorting by time updated _and_ it's not showing the timestamp. Am I just missing something? Some header link I need to include?

    I've read and re-read http://codex.wordpress.org/Template_Tags/get_links . I am dense so...

    Thanks for any help,
    Will

  2. syrupcore
    Member
    Posted 9 years ago #

    Really? No one? Do I need to give you more info or is there something funny on my face?

  3. syrupcore
    Member
    Posted 9 years ago #

    The above still isn't working but now I have another question...

    I'd like to limit it to links added today. I was trying to figure out how to do this via wpdb query but can't get it. I'm sure it's there. I'm still a PHP noob. Something like, get an array of links that have a date of today and make me a ul li of them, sorted in reverse. Anyone doing this?

    Thanks!

  4. oriecat
    Member
    Posted 9 years ago #

    To just get the latest ones, couldn't you use a reverse ID sort order?

  5. syrupcore
    Member
    Posted 9 years ago #

    I thought so too oriecat but that's part of my problem (see post 1).

    Thanks.

  6. oriecat
    Member
    Posted 9 years ago #

    In your example, you are sorting by _updated. Have you tried sorting by _ID?

  7. syrupcore
    Member
    Posted 9 years ago #

    re: ID - didn't even occur to me that it would accomplish the same thing. Thank you oriecat!

    It's still not showing the date added though. I dont geddit.

  8. syrupcore
    Member
    Posted 9 years ago #

    I dont mean to bump this but... can some one please help me figure out how to limit the links displayed to 'today' only?

  9. lstaley
    Member
    Posted 8 years ago #

    I too have this problem. Like Will I want my links to sort by last updated with the link with the most recent posts at the top. I cannot get it to do it. Is this a bug or am I doing something wrong (quite possible)? My get_links code is: <?php get_links('-1', '<li>', '</li>', '', 0, '_updated', 0, 0, -1, 0); ?> and I use the Blix theme as my template.

    Thanks.
    Louise

  10. seb
    Member
    Posted 8 years ago #

    I realise this thread is from last year, but I'm having the same problem (listing the most recently updated links first and with date). I tried wp_get_links plus parameters and get_links plus Link Manager. I also solved the problem of listing the latest links first by sorting by ID... but I don't get a date stamp either way, neither in the link text nor in the tooltip.

    Any help would be appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags