I have the JQuery code for an autocomplete field, but I am going to be adding a whole lot of possibilities. Like thousands. So I'm wanting to put them in my wordpress/buddypress database. The issue is that I've never worked with databases or anything like that. So really I have no clue how to do this. I also would like to add an image to be related to each possible answer. I know I'll have to create this database, and I'm fine with that. I'm just trying to figure out how to incorporate it.

Here is the JQuery code. This is more of an example and isn't the exact type of information I'll be feeding it.

      <!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <title>autocomplete demo</title>
  <link rel="stylesheet"     href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.12.4.js"></script>
  <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<label for="autocomplete">Select a programming language: </label>
<input id="autocomplete">

$( "#autocomplete" ).autocomplete({
  source: [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"     ]

  • You've got options, custom post types, post meta, taxonomies. If you can fit your data into one or a combination of those, you save yourself some time. Are you loading this data in one go? Are you wanting to query on it to get a subset?
    – Milo
    Commented Jan 21, 2017 at 1:58
  • A post type now that I think about it. I'd want it to take the image from the post type's featured image and then the title. I know it has to go into functions.php, as I found on here: wordpress.stackexchange.com/questions/58576/… But how do you then add that to a template? I'm really sorry if I'm a super noob. I'm pretty proud of what I've learned so far, but I have a TON left to learn I know.
    – geektripp
    Commented Jan 21, 2017 at 19:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.