-
AuthorPosts
-
November 27, 2014 at 5:28 pm #359083
Hi guys,
I use zTranslate plugin (same as qTranslate) and faced with a problem.
I try to prevent reverting to the default language when I click on “home” in menu and it actually works (exept when I click on the logo), but this code disables menu items underline.
No underline:
Should be like this:
This is the code I insert into functions.php of the child theme:// Fix for zTranslate plugin and "Home" menu link reverting back to default language if (function_exists('ztrans_convertURL')) { function ztrans_in_nav_el($output, $item, $depth, $args) { $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : ''; $attributes .=!empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : ''; $attributes .=!empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : ''; // Integration with zTranslate Plugin $attributes .=!empty($item->url) ? ' href="' . esc_attr( ztrans_convertURL($item->url) ) . '"' : ''; $output = $args->before; $output .= '<a' . $attributes . '>'; $output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after; $output .= '</a>'; $output .= $args->after; return $output; } add_filter('walker_nav_menu_start_el', 'ztrans_in_nav_el', 10, 4); }
Do you know what damages the underline?
I also tried to insert this code into helper-main-menu.php:
<a href="<?php bloginfo('url'); ?>"><?php _e('[:en]Home[:ru]Начало'); ?></a>
Instead of this one:
<a href="http://dubinchuk.com"><?php _e('[:en]Home[:ru]Начало'); ?></a>
The underlines don’t disappear. When I use the second language and click on the “home” in menu everything is fine, but when I click on the logo, this page opens – http://dubinchuk.com/en/en (this page doesn’t exist because of the additional “/en”November 28, 2014 at 6:14 am #359400Hey Speedskater!
Thank you for using Enfold.
I’m sorry but looks like you’re alone on this one. This is the first time someone reported using that plugin. As stated on our support policy, we don’t provide support for third party plugins. Please hire a freelance developer to configure the plugin or use WPML which is compatible with the theme.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.