• ausip

    (@ausip)


    I want to create a customised menu item as the last menu item in wp_nav_menu

    I know this can be done using the following code:

    add_filter('wp_nav_menu_items', 'add_search_to_nav', 10, 2);
    
    function add_search_to_nav($items, $args)
    {
        $items .= '<li>SEARCH</li>';
        return $items;
    }

    Where
    <li>SEARCH</li>
    can be replaced by my code.

    <div>Follow Us:</div>
    <div style="float: left;">
    <a href="facebookURL"><img src="<?php bloginfo('template_directory'); ?>/images/facebook.png" /></a>
    <a href="twitterURL"><img src="<?php bloginfo('template_directory'); ?>/images/twitter.png" /></a>
    <a href="rssURL"><img src="<?php bloginfo('template_directory'); ?>/images/rss.png" /></a>
    </div>
    <div style="clear: both;">
    </div>

    The tricky bit with my situation is that it is a multisite environment and I want the custom item to be different on each child site. ie: facebookURL, twitterURL, rssURL

    Is it possible to have a variable for each of these values that can be configured from the Network Admin / Sites / child site / Settings area.

    This way I can edit the template to include the above function & code in the functions.php and then I can configure the individual URL’s for each child site, therefore customising the menu for each child site of the Multi-Site network.

    Here is the site in question.
    http://www.my-gopro.com

    Thanks in advance

The topic ‘Create custom menu item in MultiSite’ is closed to new replies.