Header image duplicated by a function?
-
i have inserted this function (which i copyied from another site):
<pre>
function languages_list(){
$languages = icl_get_languages('skip_missing=0');
if(!empty($languages)){
echo '<div id="footer_language_list">
<ul>';
foreach($languages as $l){
echo '
<li>';
if($l['country_flag_url']){
if(!$l['active']) echo '<a href="'.$l['url'].'">';
echo '<img src="'.$l['country_flag_url'].'" alt="'.$l['language_code'].'" />';
if(!$l['active']) echo '</a>';
}
if(!$l['active']) echo '<a href="'.$l['url'].'">';
echo '</a></li>
';
}
echo '</ul>
</div>';
}
}
</pre>Then i ebabled an action hook: “graphene_top_bar” and then i placed in the Graphene Tob Bar area a php/text widget with this call: <?php languages_list(); ?>
After editing some css (in my child theme’s css) i got the language selector which you can see here: http://www.domnista.gr
When i view with Google Chrome everything looks fine.
When i view with Internet Explorer the header image is duplicated.
Any help?
I solved my problem.
What i did was to replace the function code with this one:
function language_selector_flags(){
$languages = icl_get_languages('skip_missing=0&orderby=code');
if(!empty($languages)){
foreach($languages as $l){
if(!$l) echo '';
echo '';
if(!$l) echo '';
}
}
}
Then i placed this code in a php/text widget:
<div id="flags_language_selector"><?php language_selector_flags(); ?></div >
Then i placed the widget in the dynamic widget area “Graphene Tob Bar” which i created using graphene’s theme options > action hook > header > “graphene_top_bar” and after making some css:
#flags_language_selector img {
margin: 4px;
border: 1px solid #2477BB;
now everything works well!
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.