• Hello,

    Any help much appreciated!

    I am using wp_dropdown_categories in a form like this:

    <form action="<?php bloginfo('url'); ?>" method="post">
    <?php $select = wt_get_category_ID();
    wp_dropdown_categories("class=large&&show_count=true&selected=".$select.""); ?>
    <input id="submit" type='image' src='<?php bloginfo('template_directory'); ?>/images/search.png'/></div>
    
    </form>

    The problem is the URL stays showing domainname.com each time I select a category and click search. This causes a problem when the category has many posts and requires pagination.

    I am using the PageNavi plugin and when I click to view page 2 it doesn’t work as it goes to domainname.com/page/2/ instead of domainname.com/category/page/2/. (works great the rest of the time, just not with this form as it stays on root url).

    Do you know how I could set up the form so it actually goes to the true url when I search rather than staying at the root.

    An idea is to submit the form to a a different file to process the search but im not sure.

    Thanks in advance for any help.

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

    (@scdwb)

    Can anyone help me out with this?

    Thanks

    Thread Starter scdwb

    (@scdwb)

    Simply changing the form method from post to get solved this problem. As now when I use the form the url is domainname.com/category/ and therefore page navi works fine.

    The only problem now is that because I am using an image for the form submit, and using method get, the url has /?x=N&y=N parameters. Still works but I am going to search and find away to remove these as they aren’t useful to me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_dropdown_categories problem – Show roots URL’ is closed to new replies.