I’ve been really enjoying the new menu management system in WP 3.0, but there a core bit of functionality that I can’t seem to find: using template tags to generate a menu item.
Specifically, I would like to be able to add Site Admin/Register (wp_register() ) and Login/Logout (wp_loginout() ) links to one of my menus. This doesn’t appear to be an option currently. I thought about embedding them using ‘after’/’before’ (or ‘link_after’/’link_before’), but these shove the result of the tag outside the menu, breaking menu functionality.
Any help/solutions would be greatly appreciated. Am I missing something simple?
Well you could add the URL to ‘where’ to register as a cutom link. If you don’t see a Custom Links module in Appearance->Menus then check your Screen Options.
I thought about doing that, but the issue is that then it will continue to list as “Register” (or whatever else I decide to name it), instead of changing the link automatically depending on whether you are logged in or not.
I’ve experimented with erasing the “http://” starting text in the “Custom Links” section and adding the template tag that way, but it still tries to treat it as a link rather than a tag (and re-adds the http://).
What’s the point of having dynamic links if we can’t use them in menus?
The kludge that seems to work is to manually recreate the menu structure. This defeats the point of having menu management, but it does seem to work.
As an example, using the twentyten theme’s menu setup:
<div id="access" role="navigation"> <?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> <div class="menu-header"> <ul class="menu"> <li class="menu-item"><?php wp_loginout(); ?></li> </ul> </div> </div><!-- #access -->
Ideally, there should simply be a way to include dynamic links like wp_register and wp_loginout in the menu management.
I agree with Nadreck on this one; I love the new custom menus, but being able to use the template tags would be very useful (I thought I was the only one that noticed this…can’t find anything else online about this or any workarounds for it that doesn’t involve using older methods.)!
You all might like this (I know htis is 5 months old, but I know people are looking for this):
- The topic ‘Using template tags in the new menu manager’ is closed to new replies.