I have tried to write this myself and searched here and the Interwebs endlessly but I cannot get it to work or find an example that uses dynamic code in the sidebar.php file combined with code in the functions.php file that will generate a dynamic vertical sidebar accordion menu from a "custom menu" that includes both Pages and Categories. Has this ever been done before? Can anyone help?
I can make this work as a static sidebar menu but I do not understand how to code the sidebar.php (
<?php wp_nav_menu($arg); ?>) file with my CSS code so that it works correctly.