• I’d like to add some code into my sidebar so that the editor can select what navigation they use in the sidebar without having to create a new template. My idea was to have a custom field called SidebarNav and the menu title is typed in there. This title is then picked up in the code in the sidebar specifying the menu to be shown. My php is very basic so merging these two lines doesn’t work with my limited knowledge; does anyone know if it’s possible and if so how to do it?

    the following is the code I would use to show the custom field for the sidebar nav name eg Resorts

    <?php $SidebarNav = get_post_meta($post->ID, 'SidebarNav', true); ?><?php echo $SidebarNav; ?>
    
    the word Resorts would then be picked up in this bit of code in the sidebar
    <?php wp_nav_menu(array('menu' => 'Resorts')); ?>

    so in effect I’d like to merge the first line of code into the bit where it says Resorts in the second line of code.

  • The topic ‘Using custom menus and custom posts together’ is closed to new replies.