Forums

[resolved] Adding a static link in a dynamic menu - possible? (4 posts)

  1. AlternativePhotography
    Member
    Posted 2 years ago #

    I'm transferring a website from static html to wordpress. There is however a gallery part (Gallery2) which I won't transfer, but make it look as if it's integrated into the website.
    When people click on "Gallery" at the top, I want them to come to the Gallery site. So, can i include a hardcoded url in the dyanamic menu somehow, to make it appear as if they are the same?
    Really appreciate any tips here! :-)
    (Using sandbox theme)

  2. That theme uses pages for the dynamic menu, right?

    You can do this: http://wordpress.org/extend/plugins/page-links-to/

    Which is probably the easiest :)

  3. Edward Caissie
    Member
    Posted 2 years ago #

    Off the cuff ...

    You will have to edit the function sandbox_globalnav() in the functions.php template file.

    function sandbox_globalnav() {
    	if ( $menu = str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') ) )
    		$menu = '<ul>' . $menu . '</ul>';
    	$menu = '<div id="menu">' . $menu . "</div>\n";
    	echo apply_filters( 'globalnav_menu', $menu ); // Filter to override default globalnav: globalnav_menu
    }

    Change the line: $menu = '<ul>' . $menu . '</ul>'; to:

    $menu = '<ul>' . $menu . '<li><a href="http://link-to-your-gallery">Gallery Link</a></li>' . '</ul>';

    ... untested, but it should work (or at least get you started) ...

  4. AlternativePhotography
    Member
    Posted 2 years ago #

    Thank you both of you! Very helpful!

Topic Closed

This topic has been closed to new replies.

About this Topic