Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Was wondering if anyone could recommend a good way to display a single, random post from a wp_dropdown_categories() menu. Basically, I have a custom post type called Tips and a taxonomy term called Tip Categories. I want to display the Tip Categories in a dropdown (which I have done already using wp_dropdown_categories), then when a user selects a Tip Category and clicks a submit button, a random tip from that category will display.

I suppose I can figure out a way to do this on the front end with Javascript/CSS (generating all tips, then showing/hiding them) but it seems like it would be best to generate one tip and do it all in PHP. Anyone have an idea of how best to accomplish this? Can I somehow pass the value of the wp_dropdown_categories selection to WP_Query()? Maybe this is easier than I thought and I'm missing something?

share|improve this question

closed as not a real question by toscho Jul 13 '12 at 20:00

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.