Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author DesignsAndCode

    (@designsandcode)

    Hey donnytree that is strange, have you got a link I could look at?

    Thread Starter donnytree

    (@donnytree)

    Thread Starter donnytree

    (@donnytree)

    It also happens that the category it’s defaulting on, “featured” is one I would like to omit from the dropdown…

    Thanks again!

    Plugin Author DesignsAndCode

    (@designsandcode)

    Hi donnytree I’ve managed to have a little look in to this.

    Basically, to preselect your different inputs such as the category dropdown, the plugin will look at this variable from WP

    global $wp_query;
        $wp_query->query['category_name']

    So it seems your homepage is actually a category page for the category “featured” – and the plugin is understanding this and preselecting the featured category.

    If you set up your homepage a bit different, such as not making it a category page (I’m guessing you have used some plugin to achieve this), and then modify the query using something like pre_get_posts to filter the results by the featured category then the plugin hopefully will not be preselected.

    I guess the easiest way around all this is for you to be able to exclude the category as you mention but this is not possible with the plugin.

    If you’re comfortable with PHP I would take a look at the walk_taxonomy function on line 1670 of searchandfilter.php and pass some arguments to the function wp_list_categories – you can read up on valid arguments here -http://codex.wordpress.org/Template_Tags/wp_list_categories – and maybe you can do a little mod to exclude that category.

    Thats all I can suggest for now, otherwise you’ll have to wait for an update which includes all this but it looks like that might not be for a while :/

    Thanks

    Thread Starter donnytree

    (@donnytree)

    Ahh, OK, that makes sense. And thanks for the heads up about the walk_taxonomy function, I had tried to figure it out but couldn’t find the relevant line of code in your plugin files.

    Thanks so much for this awesome plugin and for the quick responses!

    Plugin Author DesignsAndCode

    (@designsandcode)

    No worries donnytree happy to help – feel free to leave a rating for the plugin 😉

    Thread Starter donnytree

    (@donnytree)

    I will for sure, thanks!

    Thread Starter donnytree

    (@donnytree)

    Sorry to bug you again, that line of code didn’t do anything when I altered it, line 1664 in search-filter.php:

    $output = wp_list_categories('exclude=2');

    I am using a dropdown menu of choices, is there somewhere else I can look?

    Thread Starter donnytree

    (@donnytree)

    OK I think I found the right spot, line 1422 in the generate_wp_dropdown function, but now it’s putting in two dropdown menus??

    Thread Starter donnytree

    (@donnytree)

    Woo hoo, I got it. Thanks! In the generate_wp_dropdown function I added:
    $args['exclude'] = 2;

    Thanks!

    Thanks a lot for this thread. I had the same issue with the order of the drop down menu. I sorted it out by inserting a generic query ahead of my sidebar, which had the effect of resetting the categories.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘default "All Categories" in dropdown menu’ is closed to new replies.