Title: HACK:  wp_dropdown_categories  (will pay$ for code)
Last modified: August 19, 2016

---

# HACK: wp_dropdown_categories (will pay$ for code)

 *  Resolved [volleyballmaniac](https://wordpress.org/support/users/volleyballmaniac/)
 * (@volleyballmaniac)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/hack-wp_dropdown_categories-will-pay-for-code/)
 * If anyone can figure this out I will PayPal you **$50** for your troubles.
    _(
   I know you have to take me at my word, but you might note that I have been a 
   long-time member of this forum, and I’m here to stay)_
 * I realize that normally cash isn’t offered on this forum, but my question is 
   rather unorthodox, and could be more complex than I thought (and I’m quite desperate).
   If you feel like this problem is worth more than $50, I’ll be willing to negotiate.
 * If you’d rather deal with me directly, please email me at: **volleyballmaniac[
   at] gmail . com**
 * Link to Example Page: [http://nightlife.hotguam.com/category/bar/irish-pub](http://nightlife.hotguam.com/category/bar/irish-pub)
 * You will notice on the above page that you are looking at the “Irish Pub” category.
 * On the right-hand sidebar, you will notice a “Choose Location” dropdown. This
   was generated using the **wp_dropdown_categories** function. I set the parameters
   to return all sub-categories under the ‘Location’ category AND to show sub-categories
   only if they have at least one post. _(Please select a location to see how I’m
   using it)_.
 * It works as designed, but here is my issue: It lists ALL ‘Location’ sub-categories
   that have a single post EVEN if they don’t have a post in the “Irish Pub” category.
   So if a user clicks on “Agat”, they are taken to my custom “No Posts in this 
   Category” Page. This can get very irritating for the user.
 * Instead of listing ALL ‘Location’ sub-categories that have at least one post,
   I ONLY want it to list ‘Location’ sub-categories that have at least one post 
   in the “Irish Pub” category as well.
 * So if there are no Irish Pubs in “Agat”, then I don’t want “Agat” showing up 
   in the drop-down.
 * **RANDOM NOTES:**
    – I had a notion that I could auto-populate the ‘exclude’ 
   parameter of wp_dropdown_categories, based on the present category being viewed,
   but I’ve no idea how to code this.

Viewing 1 replies (of 1 total)

 *  Thread Starter [volleyballmaniac](https://wordpress.org/support/users/volleyballmaniac/)
 * (@volleyballmaniac)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/hack-wp_dropdown_categories-will-pay-for-code/#post-840511)
 * I am currently being helped by an individual. So I’m considering this request
   closed.

Viewing 1 replies (of 1 total)

The topic ‘HACK: wp_dropdown_categories (will pay$ for code)’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [category](https://wordpress.org/support/topic-tag/category/)
 * [modification](https://wordpress.org/support/topic-tag/modification/)
 * [wp_dropdown_categories](https://wordpress.org/support/topic-tag/wp_dropdown_categories/)

 * 1 reply
 * 1 participant
 * Last reply from: [volleyballmaniac](https://wordpress.org/support/users/volleyballmaniac/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/hack-wp_dropdown_categories-will-pay-for-code/#post-840511)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
