How do i ad <span></span> to the menu code? - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: How do i ad <span></span> to the menu code? (/showthread.php?tid=1775) |
How do i ad <span></span> to the menu code? - rune1980 - 2011-05-29 Hi All! How do i add <span>MY_LINK</span> around my menu links? I need it to get a specific menu to work :S I need my links to look like this: <li><a href="#" title="home" class="current"><span>MY_LINK</span></a></li> How do i ad <span></span> to the menu code? - polyfragmented - 2011-05-29 Assuming you're using the out-of-the-box navigation, in file /admin/inc/theme-functions on line 649 you find Code: $menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n"; How do i ad <span></span> to the menu code? - rune1980 - 2011-05-29 Super! and thanks for quick response How do i ad <span></span> to the menu code? - n00dles101 - 2011-05-29 or alternatively instead of editing the core files which as Thorsten has explained wil break your site if you update the core files, you could create a functions.php file in your template folder if it does not already exist. Copy and paste the "get_navigation" function from the /admin/inc/theme_function.php file and rename the function to my_get_navigation or something similar. CHange the line as outlined above to iclude your <span> tags then in you template call this function instead where your now calling get_navigation. /mike.... How do i ad <span></span> to the menu code? - polyfragmented - 2011-05-29 Awesome addition, Mike! Update-safe is even better! :-) +1 How do i ad <span></span> to the menu code? - rune1980 - 2011-05-29 absolutely super! thanks How do i ad <span></span> to the menu code? - ANSH7662 - 2012-04-04 how to add span tag in the theme_function.php Code: function get_navigation($currentpage) { How do i ad <span></span> to the menu code? - Angryboy - 2012-04-05 ANSH7662 Wrote:how to add span tag in the theme_function.php Change get_navigation to get_navigation_span in the top line, then change: Code: $menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n"; to Code: $menu .= '<li class="'. $classes .'"><span class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></span></li>'."\n"; Then when you call for the navigation in your theme, use <?php get_navigation_span(); ?>. RE: How do i ad <span></span> to the menu code? - davetest - 2013-03-02 I can't get the above to work with 3.1.2. Should the above still work with this version please? |