querying wp_get_archives()
-
I’m designing a theme and want to know if the following is possible:
For my archives section I have the layout like this
<ul> <li class="first_item">most recent month</li> <li>next month</li> <li>etc</li> </ul>
In order for this to display properly I need to call wp_get_archives() but some how limit it to get the most recent archive only, then generate the rest of the archive items as normal with the default
- tags, excluding the most recent.
So my question is not how to limit what archives to get but how do I keep track of the first one I’ve retrieved and separate it from the rest of the archives? Or how to exclude archives?
So basically it needs to look something like this:
<h3>Archives</h3> <ul> <?php wp_get_archives(get the most recent month with custom formating, etc.); ?> <?php wp_get_archives(exclude the most recent month archive, but get the rest, no formating); ?> </ul>
I’ve noticed that there are exclude parameters you can pass to other wp functions but didn’t see it mentioned with this particular function.
- The topic ‘querying wp_get_archives()’ is closed to new replies.