generalsalt
Member
Posted 2 years ago #
For get_categories() and wp_get_all_tags() I am returning an array passing that array to a function that creates columns.
I really need to keep with the same layout with wp_get_archives(). I want to display archives (per month) in a column format.
wp_get_archives() doesn't seem to offer a way to return results as an array. So that is my question, is there a way to make that happen? Many thanks!
<?php
$archi = wp_get_archives( 'echo=0' );
$archi = explode( '</li>' , $archi );
$links = array();
foreach( $archi as $link ) {
$link = str_replace( array( '<li>' , "\n" , "\t" , "\s" ), '' , $link );
if( '' != $link )
$links[] = $link;
else
continue;
}
print '<pre>';
print_r( $links );
print '</pre>';
?>
Printing at the end is to show you the array, do as you will..
generalsalt
Member
Posted 2 years ago #