• Hi, is there a way to autocomplete taxonomy while adding an article suggesting existing tags starting with same letters?

    For example, I have existing tag let’s say “food” and “beverages”. I’d like that, when I start typing:

    bev

    wp to suggest beverages, like in Facebook of Linkedin when you use @ or #

    • This topic was modified 4 years, 4 months ago by maegras.
    • This topic was modified 4 years, 4 months ago by maegras.
Viewing 5 replies - 1 through 5 (of 5 total)
  • I just tested both editors, and they both do this already, even on custom taxonomies.

    Thread Starter maegras

    (@maegras)

    Oh, sorry, I was not enough clear. I meant on frontend, not wp-admin.
    In backend it works

    If you are adding an article from the front end, you are using a plugin to do that. So you should ask at that plugin’s support forum.

    Thread Starter maegras

    (@maegras)

    I’m using a template but this function is not provided. I’d like to add it if there is an easy way to do that or, if some coding is required, at least a starting point to code a child template page to achieve this

    Thanks for your help

    Which “template”?
    In the WordPress world, there is (usually) a distinction between what is called “theme” territory and “plugin territory”. Ideally, themes should not wade into plugin territory and should only deal with presenting content appearance-wise.

    There will probably be some coding required.
    The taxonomy values could probably be stored as a variable when the page is edited (so the database needs to be queried).
    The variable could then be accessed later on via JavaScript to provide auto-complete suggestions.

    Something that involves querying the database is probably not a good choice if this is your first project though.
    You need to be familiar with capabilities, as well as sanitizing and escaping in order to not make your site (more) vulnerable to various sorts of exploits.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add tags to article using ajax’ is closed to new replies.