I checked that there is an shortcode on wordpress.com but it seems there is no build in way of adding the shortcode of archive on wordpress.org site. I know there was one plugin in repo but it's 2 years old with no updates in code.
So let's say if i want to return the archive. following shortcode doesn't work. Is there anything I am missing? Or is there any way to make this work?
function archive{
return '<?php wp_get_archives('type=monthly'); ?>';
}
add_action('archives', 'archive');
archive
. This will cause a fatal error if a plug-in/theme/WordPress defines a function of the same name.