Support » Themes and Templates » how to use Matt Mullenweg’s script menu?

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

  • Home
  • Archives
  • About
  • Photos
  • Music
  • Scripts
  • Jazz Quotes
  • Toys
  • Syndicate
  • Portal
  • Zeitgeist
  • Contact
  • 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>
    $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
    i ask to Matt but no response actually!

Viewing 1 replies (of 1 total)
  • Sorry here is a code of Matt but how to use it?

    $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>
    $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";
Viewing 1 replies (of 1 total)
  • The topic ‘how to use Matt Mullenweg’s script menu?’ is closed to new replies.