Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter csaknoriss

    (@csaknoriss)

    Solution:

    Actually I have a better solution to the above, reverse all the changes you did above to the functions.php and just add this one function instead:

    // Fix for qTranslate plugin and “Home” menu link reverting back to default language

    if (function_exists(‘qtrans_convertURL’)) {

    function qtrans_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 qTranslate Plugin

    $attributes .=!empty($item->url) ? ‘ href=”‘ . esc_attr( qtrans_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 .= ”;

    $output .= $args->after;

    return $output;

    }

    add_filter(‘walker_nav_menu_start_el’, ‘qtrans_in_nav_el’, 10, 4);

    }

    Thread Starter csaknoriss

    (@csaknoriss)

    rainbow-trance-10 theme.
    wp: 3.4.1
    qtranslate: 2.5.31

Viewing 2 replies - 1 through 2 (of 2 total)