parameters for <?php get_archives() ?>? (5 posts)

  1. Mike Little
    Posted 12 years ago #

    function get_archives($type='', $limit='', $format='html', $before = "", $after = "", $show_post_count = false)
    type = one of 'monthly', 'daily', 'weekly', or 'postbypost', empty = use option configured type
    limit = limit number of entries/months/weeks/etc. returned
    format = one of 'link', 'option', 'html' or empty
    link will output link rel="archives" entries
    option will output option value= entries for use in a form
    html will output list item links
    empty will use the before and after params
    before is for text/html to be output before the link
    after is for text/html to be output after the link (and also after the link but before the closing list item tag in html mode)
    show_post_count = whether to show a count of posts for that month (only works in monthly mode)
    Hope this helps,

  2. notthatugly
    Posted 12 years ago #

    That's great -- thanks!

  3. Xial
    Posted 12 years ago #

    Clearly, I'm out of my league.
    I would use get_archives(weekly,,option) if I wanted to override the default, and have a dropdown list for my archives, on a weekly basis? or would I have to manipulate the function directly (which is not optimal, as I use CVS builds)?

  4. Mike Little
    Posted 12 years ago #

    Try something like this (taken from this thread):
    <form name="archiveform" action="">
    <select name="archive" onchange="window.open(document.forms.archiveform.archive[document.forms.archiveform.archive.selectedIndex].value);">
    <?php get_archives('weekly','','option'); ?>
    I'm not 100% on the javascript but I think it should work.

  5. Jaykul
    Posted 12 years ago #

    Feature Request: An optional categor(y|ies) parameter, which would let us use this on individual post pages to list other posts in the same category ... that would be really nice.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.