WordPress.org

Ready to get started?Download WordPress

Forums

how to use Matt Mullenweg's script menu? (2 posts)

  1. Baudry
    Member
    Posted 6 years ago #

    Hello I would like to know how to use the Matt Mullenweig's men on my wordpress :`Intelligent Menu Code
    <?php
    $menu = <<<MENU
    <ul id="nav">

  2. Home
  3. Archives
  4. About
  5. Photos
  6. Music
  7. Scripts
  8. Jazz Quotes
  9. Toys
  10. Syndicate
  11. Portal
  12. Zeitgeist
  13. Contact
  14. MENU;

    $lines = split("\n", $menu);
    foreach ($lines as $line) {
    $current = false;
    preg_match('/href="([^"]+)"/', $line, $url);
    if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) {
    $line = str_replace('<a h', '<a id="current" h', $line);
    }
    echo $line."\n";
    }
    ?>"`

    is it possible to make something whith this for my pages

    <?php elseif ( is_page('home') )?><?php
    $menuhome = <<<MENUHOME
    <ul id="menu_oupocreanum">
        <li><a href="/" title="home" id="menu_home_on"><span class="off">home</span></a></li>
        <li><a href="/biography/" title="biography" id="menu_biography"><span class="off">biography</span></a></li>
        <li><a href="/randomizer/"  title="randomizer" id="menu_random"><span class="off">randomizer</span></a></li>
        <li><a href="/workingprogress/" title="workingprogress" id="menu_workingprogress"><span class="off">workingprogress</span></a></li>
        <li><a href="/play/" title="play" id="menu_play"><span class="off">play</span></a></li>
        <li><a href="/videos/" title="videos" id="menu_videos"><span class="off">videos</span></a></li>
        <li><a href="/pictures/" title="pictures" id="menu_pictures"><span class="off">pictures</span></a></li>
        <li><a href="/sounds/" title="sounds" id="menu_sounds"><span class="off">sounds</span></a></li>
        <li><a href="/exhibition/" title="exhibition" id="menu_exhibition"><span class="off">exhibition</span></a></li>
        <li><a href="/software/" title="software" id="menu_software"><span class="off">software</span></a></li>
        <li><a href="/abstracts/" title="abstracts" id="menu_abstracts"><span class="off">abstracts</span></a></li>
        <li><a href="/diagrams/" title="diagrams" id="menu_diagrams"><span class="off">diagrams</span></a></li>
    
        <li><a href="/machines/" title="machines" id="menu_machines"><span class="off">machines</span></a></li>
        <li><a href="/artists/" title="artists" id="menu_artists"><span class="off">artists</span></a></li>
        <li><a href="/bibliography/" title="bibliography" id="menu_bibliography"><span class="off">bibliography</span></a></li>
        <li><a href="/webography/" title="webography" id="menu_webography"><span class="off">webography</span></a></li>
        <li><a href="/discography/" title="discography" id="menu_discography"><span class="off">discography</span></a></li>
        <li><a href="/citations/" title="citations" id="menu_citations"><span class="off">citations</span></a></li>
        <li><a href="/lexicon on interactivity/" title="lexicon on interactivity" id="menu_lexique"><span class="off">lexicon on interactivity</span></a></li>
        <li><a href="/forum/" title="forum" id="menu_forum"><span class="off">forum</span></a></li>
        <li><a href="/upload/" title="upload" id="menu_upload"><span class="off">upload</span></a></li>
        <li><a href="/thanks/" title="thanks" id="menu_thanks"><span class="off">thanks</span></a></li>
        <li><a href="/links/" title="links" id="menu_links"><span class="off">links</span></a></li>
    
    </ul>
    MENUHOME;
    
    $lines = split("\n", $menuhome);
    foreach ($lines as $line) {
        $current = false;
        preg_match('/href="([^"]+)"/', $line, $url);
        if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) {
            $line = str_replace('<a h', '<a id="current" h', $line);
            }
        echo $line."\n";
    }
    ?>

    my website adress is olivierbaudrydesign.free.fr
    i ask to Matt but no response actually!

  • Baudry
    Member
    Posted 6 years ago #

    Sorry here is a code of Matt but how to use it?

    <?php
    $menu = <<<MENU
    <ul id="nav">
        <li><a href="/" title="Where the heart is">Home</a></li>
        <li><a href="/archives/" title="Things that have passed.">Archives</a></li>
        <li><a href="/about/" title="All about Matt">About</a></li>
        <li><a href="/photos/" title="It's the 'photo' in Matt">Photos</a></li>
        <li><a href="/music/" title="The food of love">Music</a></li>
        <li><a href="/scripts/" title="Free (as in beer and speech) code">Scripts</a></li>
        <li><a href="/jazzquotes/" title="Great quotes from amazing musicians. More in the future.">Jazz Quotes</a></li>
        <li><a href="/toys/" title="Make me tick: Reviews of various electronics I own or have come into contact with.">Toys</a></li>
        <li><a href="/xml/" title="Syndicate the content here. Get Matt to-go.">Syndicate</a></li>
        <li><a href="/portal/" title="My personal start page, has my blogroll and links to interesting sites">Portal</a></li>
        <li><a href="/zeitgeist/" title="A google of random stats about the website">Zeitgeist</a></li>
        <li><a href="/contact/" title="Reach out and touch somebody. How to get in contact with me, also has GPG key and geek code.">Contact</a></li>
    </ul>
    MENU;
    
    $lines = split("\n", $menu);
    foreach ($lines as $line) {
        $current = false;
        preg_match('/href="([^"]+)"/', $line, $url);
        if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) {
            $line = str_replace('<a h', '<a id="current" h', $line);
            }
        echo $line."\n";
    }
    ?>
  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags