Dropdown navigation multilanguage categories
-
Hi all,
We have developed a site recently and there seems to be a problem with the navigation when we use a dropdown selection menu to navigate from page to page.
On this page with references, we provide a simple dropdown menu in order to allow the visitor to narrow down the posts (custom post type “references”) according to their categories (custom taxonomy “protype”).
This works fine in the default Dutch (NL) language, but fails in the selected English (EN) language. As you select a category from the dropdown menu, it refers back to the NL version of the page for no apparent reason.
This is the code used:
<form action="../"> <select onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option value="/<?php _e('[:nl]nl[:fr]fr[:en]en'); ?>/references/"><?php _e('[:nl]Alle diensten[:fr]Tous services[:en]All services'); ?></option> <?php $categories = get_categories("taxonomy=protype"); foreach($categories as $category){ $option = "<option value='/". __('[:nl]nl[:fr]fr[:en]en') ."/protype/" .$category->slug."/'>"; $option .= $category->name; $option .= "</option>"; echo $option; } ?> </select> </form>Any ideas on how to fix this problem? Thanks in advance.
The topic ‘Dropdown navigation multilanguage categories’ is closed to new replies.