Jump to content


This topic is now archived and is closed to further replies.


wp_dropdown_categories generating url ID number instead of slug

Recommended Posts

Hi all, this problem has me going nuts now.

in http://staging.tahititravel.com.au/package/

if you choose a category in the category filter box, the parent categories generate an ID number instead of the category slug in the URL. It's not SEO im worried about, it's that the WP_Query doesn't work if it doesnt generate a proper URL. So the box for sorting next to the category will not work.

The categories within the hierarchy works fine.


<form action="<?php bloginfo('url'); ?>/" method="get">
                    $select = wp_dropdown_categories('show_option_all=Filter by Category...&exclude=1,31,21&show_count=1&hide_empty=1&depth=3&hierarchical=false&orderby=name&echo=0&selected=6&taxonomy=category');
                    $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);
                    echo $select;
                    <noscript><input type="submit" value="View" /></noscript>


Share this post

Link to post
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.