OK so in the theme I'm developing I would like to have it so if the wordpress install has no widgets active in the sidebar it will automatically put some there (e.g. categories, comments etc) so the sidebar is not left empty on first install.
I've done all the register_siebar stuff and my sidebar works great. I would just like it to auto have widgets on 1st install. Once someone adds their own choice of widgets the preset ones go away.
Is there a way to achieve this in functions.php rather than hard code widgets into sidebar.php and use conditional statement?