kvspublic
Member
Posted 1 year ago #
Add this code to "header.php":
<?php
global $q_config;
if(is_404()) $url = get_option('home'); else $url = '';
echo '<ul id="headerMenuSystem">';
foreach(qtrans_getSortedLanguages() as $language)
{
$link = qtrans_convertURL('', $language);
if($_SERVER["HTTPS"] == "on")
$link = preg_replace('#^http://#','https://', $link);
echo '<li class="menu_item"><a href="'.$link.'"';
echo ' hreflang="'.$language.'" title="'.$q_config['language_name'][$language].'"';
echo '><span';
echo '>'.$q_config['language_name'][$language].'</span></a></li>';
}
echo '</ul>';
?>
TimoElshof
Member
Posted 8 months ago #
Thanks, this helps! Can you help me with removing the bullets? I also would like to have flags ('images') in php? Can you help me with that as well?
kvspublic
Member
Posted 8 months ago #
About bullets: replace "menu_item" class.
About flags: add "img" tag before "span".
TimoElshof
Member
Posted 8 months ago #
Thanks! I removed the bullets in my CSS with:
#headerMenuSystem { list-style: none; }
Do you know how to display the languages next to each other/horizontal?
kvspublic
Member
Posted 8 months ago #
replace "ul" by "table", "li" by "tr" and "td"
TimoElshof
Member
Posted 8 months ago #
I did it in the CSS:
#headerMenuSystem li { float:left; width:auto; padding:0 10px 0 0; }