Recent categories wordpress

Discussion in 'WordPress' started by Ruriko, Sep 24, 2008.

  1. #1
    I'm using wordpress and I want to know how can make a list of the latest categories with dates
     
    Ruriko, Sep 24, 2008 IP
  2. amitpatel_3001

    amitpatel_3001 Results Follow Patience

    Messages:
    14,074
    Likes Received:
    1,178
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Did you try out using widgets?
     
    amitpatel_3001, Sep 24, 2008 IP
  3. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't think there is a way to sort them by date, or list the date they were created. You can approximate it using ID number though. Each new category has an ID number greater than the last one. This should list the last five categories in descending ID order, and show the date of the last updated post.

    <?php wp_list_categories('orderby=ID&order=DESC&number=5&show_last_update=1'); ?>
     
    Cash Nebula, Sep 24, 2008 IP
  4. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Recent categories? Or recent posts? Maybe even recent comments, but what's the use of a category if every single category is exactly a new one with one post only? Lol. Anyway it can be easily done by calling the categories function with relations to published/creation date. Check out the wp forums for the hack :)
     
    godsofchaos, Sep 24, 2008 IP
  5. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It seems there is a bug with show_last_update because there are several complaints about it on the Wordpress forum. So until they fix it, dates won't show up.

    <?php wp_list_categories('orderby=id&order=desc&number=5&title_li='); ?>

    I added title_li= to stop it showing the default title 'Categories' above the list. You could change it to title_li=Recent Categories if you like.

    Also, all the category ID numberd have to be in sequential order, not skipping numbers as sometimes happens with Wordpress. There also doesn't seem to be any way to change the IDs without doing it through MySQL admin.

    Still looking for a plugin that can handle all that mess :D
     
    Cash Nebula, Sep 24, 2008 IP
  6. Ruriko

    Ruriko Well-Known Member

    Messages:
    4,023
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #6
    Ruriko, Sep 24, 2008 IP
  7. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Maybe they are editing it with the Wordpress template editor. As long as you can code, it would be no trouble.
     
    Cash Nebula, Sep 25, 2008 IP
  8. phgonline

    phgonline Peon

    Messages:
    333
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ruriko, it's done manually, if you want to have that feature you should find a programmer to create a plugin for you.
     
    phgonline, Sep 26, 2008 IP