Okay
  Public Ticket #147435
Nescar menu shortcode
Closed

Comments

  •  1
    Mac started the conversation
    Is there a way to get a custom menu into a page? I have some Parent pages an would like to display the sub pages at the left of that page. The sidebar function is not appropriate because there are different Parent pages with their own sub-menu items.
  •  1,077
    ThemeNectar replied

    Hey Mac!

    You could accomplish this by using a plugin like this: http://wordpress.org/plugins/insert-php/ and then calling your menu on pages with this:

    wp_nav_menu( array('theme_location' => 'your_custom_menu') ); 

    Cheers :)

  •  1
    Mac replied

    Unfortunately it is not working.

    In attached screenshots you can see what i want to accomplish and the page after adding the code (and installing the plugin).

    The goal is to place different menus on different Parent pages.

    Is that possible, and what is the Theme location?

    Site = http://www.goesinstallaties.nl/wordpress

  •  1,077
    ThemeNectar replied

    Hey Mac,

    The theme_location is how you define what menu to use, e.g.

    wp_nav_menu( array('theme_location' => 'secondary_nav')); 
    					

    would call the secondary navigation menu. As far as I can tell from thay plugin you need to use php code inbetween its special shortodes like this:

    [insert_php]
    
    wp_nav_menu( array('theme_location' => 'secondary_nav'));
    
    [/insert_php]

    Otherwise it's not going to parse it.

    Cheers :)

  •  1
    Mac replied

    I got this error on the page now:

    Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in/home/goesinst/public_html/wordpress/wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on line 3

    Can you please specify the exact code for this situation (attached). I want to use the menu: sidebar. This is a thirth menu only used in some categerie pages.

     

    And is it possible to use more than 2 menu's in this theme with this code?

    I'm a newbee.

  •  1,077
    ThemeNectar replied

    Hey again Mac, if that didn't work than I suppose the php processor in that plugin isn't allowing you to call WordPress specific functions. Another way to go about this could be through this: http://wordpress.org/plugins/custom-menu-wizard/ which seems promising. Apparently it allows you to place a custom menu on any page through a shortcode, which is what we tried to do further up except this will involve no coding.

    Give that a spin and let me know how it goes :)

  •  1
    Mac replied

    Thanks. This is a widget. How can i put that widget into a column of a page?

    That pages are Default Template pages with different menu's

  •  1,077
    ThemeNectar replied

    You're welcome :)

    Please see this section of its documentation - there's a shortcode you can use to place it as well which could go in a column shortcode: http://wordpress.org/plugins/custom-menu-wizard/other_notes/#Shortcode-Parameters

  •  1
    Mac replied

    It works, thanks!