Fetching posts that match a User Profile setting (2 posts)

  1. kevleitch
    Posted 2 years ago #


    I have a Custom Field in my User Profile page that allows site authors to specify which town they come from when they set up their account. The towns are in the form of a selectable dropdown select element

    What I would like to do is query the WP database to populate a dropdown of all the towns on the front end of my WP site and, when one town is selected, go to a page that lists all the authors who live in the town selected.

    Is this possible? Any help greatly appreciated.



  2. vtxyzzy
    Posted 2 years ago #

    It is certainly possible, but the code is complex enough that you probably cannot have it done here.

    Here is some sample code that shows how to create a form that allows the user to select a category and sort order, and then displays posts in that category: http://wordpress.mcdspot.com/2012/09/21/simple-form-to-select-a-category-and-sort-order/

    Perhaps you can adapt it to do what you need.

Topic Closed

This topic has been closed to new replies.

About this Topic