How to get post archives urls list without any markup?
I'm using wp_get_archives
but I cannot prepend any text inside the links. I want code like this:
a href="archive link"[my custom prepend] 2020a/
But the 'before' option will prepend the passed string before the a
tag.
Current code is the following:
$archives = wp_get_archives(array(
'type' = 'yearly'
,'echo' = false
,'format' = 'custom'
,'before' = 'News'
));
So I really would like to get a list of only years and urls, without any markup, so I can build it by myself. Thus maybe without wp_get_archives()
.
Maybe the best thing would be have a simple array like:
array(
array('year' = 2020, 'url' = 'https://www.....')
)
How to?
Topic wp-get-archives archives Wordpress
Category Web