WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] HACK: wp_dropdown_categories (will pay$ for code) (2 posts)

  1. volleyballmaniac
    Member
    Posted 6 years ago #

    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

    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.

  2. volleyballmaniac
    Member
    Posted 5 years ago #

    I am currently being helped by an individual. So I'm considering this request closed.

Topic Closed

This topic has been closed to new replies.

About this Topic