Support » Themes and Templates » wp_dropdown_categories

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    have you tried to use ‘include’ even if it is not explicitely mentioned in the codex or the core file?

    somewhere down the line, this functions uses ‘get_terms()’ which supports ‘include’ …

    alchymyth,

    I just tried it a few minutes ago and it doesn’t work 🙁 However, I’m glad you mentioned that, hadn’t thought to try it and see 🙂

    Thanks,
    Josh

    Michael

    (@alchymyth)

    Forum Moderator

    too bad – seems to work with the default taxonomy ‘category’:

    wp_dropdown_categories('taxonomy=category&id=make&show_option_all=Select Make...&include=9,1');

    I don’t have any cusotm taxonomes set up at the moment to test further.

    Hi Josh,
    I think you would create your own category dropdown and use get_categories() wich has the ‘include’ argument.

    I use categories dropdown in this child theme, you can get an example in the download, /inc/pop-meta-functions.php code, line 64 you would need to add the ‘include’, the dropdown is lines 90-103

    Thinking a little “outside the box” if the theme supports custom menus create a custom menu and add the categories, in code call the menu with wp_get_nav_menu_items() adding these into a select dropdown, much cleaner and loads more control.

    HTH

    David

    David,

    That’s a great idea, I’ll definitely use get_categories instead of wp_dropdown_categories!

    Thanks,
    Josh

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_dropdown_categories’ is closed to new replies.