Da musst Du nochmal ran. Es sollte definitiv aria-current='page' sein,
Hm. Dann wird es ja noch kürzer.
<?php
function IsCurrent( $LinkTarget ) {
if ( ! empty( $_GET['subpage'] ) ) {
return ( $LinkTarget == $_GET['subpage'] );
} else {
return ( $LinkTarget == 'game' );
}
}
### Nur für die Simulation/Tests ###
#$_GET['subpage']='';
#$_GET['subpage']='game';
$_GET['subpage']='mods';
####################################
?>
<a<?=IsCurrent('game')?' aria-current="page"':'';?> href="game">Spiel</a>
<a<?=IsCurrent('releases')?' aria-current="page"':'';?> href="releases">Releases</a>
<a<?=IsCurrent('merchandise')?' aria-current="page"':'';?> href="merchandise">Me<span style="letter-spacing: .115em;">r</span>cha<span style="letter-spacing: .105em;">n</span>dise</a>
<a<?=IsCurrent('guides')?' aria-current="page"':'';?> href="guides"><span style="letter-spacing: .105em;">Gu</span>ides</a>
<a<?=IsCurrent('emulation')?' aria-current="page"':'';?> href="emulation">Emula<span style="letter-spacing: .115em;">t</span>ion</a>
<a<?=IsCurrent('mods')?' aria-current="page"':'';?> href="mods">Mods</a>
<a<?=IsCurrent('maps')?' aria-current="page"':'';?> href="maps">Maps</a>
<a<?=IsCurrent('savegame')?' aria-current="page"':'';?> href="savegame">S<span style="letter-spacing: .105em;">a</span>vegame</a>
Output:
<a href="game">Spiel</a>
<a href="releases">Releases</a>
<a href="merchandise">Me<span style="letter-spacing: .115em;">r</span>cha<span style="letter-spacing: .105em;">n</span>dise</a>
<a href="guides"><span style="letter-spacing: .105em;">Gu</span>ides</a>
<a href="emulation">Emula<span style="letter-spacing: .115em;">t</span>ion</a>
<a aria-current="page" href="mods">Mods</a>
<a href="maps">Maps</a>
<a href="savegame">S<span style="letter-spacing: .105em;">a</span>vegame</a>