Support » Developing with WordPress » Filter and show database value based on user selection

  • I want to have some questions on screen with checkboxes and radio buttons as options and based on user selection I want to fetch data from the database and show it to user.

    I do not know any coding and hence I chose wordpress to do this but it seems I still need some coding skills which is why I am here.

    I have created a database and I can create questions with checkboxes with elementor. I am stuck with what happens and how when I click on submit.

    How can I take user inputs with multiple selections for different questions and fetch value from db based on those.

    Any help is greatly appreciated.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    If you want to filter posts and want to avoid custom coding, try out a few of the filtering plugins.

    Depending on what sort of data you are filtering, you may not need custom coding. You would only need to properly name the form fields so they become the correct URL query vars to return the desired content. Let’s say you wanted to make a form that lets users select what category they want to view. If you name the form field “category_name” and have its selection values be identical to category slug names, a GET method URL might look like https://example.com/?category_name=foo. Assuming the user selected the “Foo” option.

    If you have somewhat complex filtering needs, you probably are looking at some custom coding. The form data would need to be translated into appropriate query vars that WP will use to get the desired posts. The code to process the form data and make the query and display results could all reside on a custom page template.

    Thread Starter praveshpandey

    (@praveshpandey)

    Hi Bcworkz, thanks but normal filtering plugins are not helpful to me. Would you be willing to spend 10 minutes with me over zoom? I ask because I am not able to move forward here.

    Moderator bcworkz

    (@bcworkz)

    I’m sorry, I am unable to help you in real time. I recognize asynchronous communication through this forum is very slow and tedious, but it’s the only form of assistance I personally offer. There is a WP chat channel over IRC. I don’t participate there, but if someone knowledgeable happens to be online at the time it can be a good way to have your questions answered in short order.

    While the format isn’t much different, you might get faster responses at wordpress.stackexchange.com. There seems to be more participants in general over there. Alternately, you could hire an expert from sites like https://jobs.wordpress.net/ or https://jetpack.pro/ to help you for 10 minutes or so.

    Or if you have enough patience, continue asking questions here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.