Home Forums Plugin Support WP User Frontend Pro Tags autocomplete in frontend post form?

This topic is: resolved

Tagged: ,

This topic contains 7 replies, has 3 voices, and was last updated by  kolhoffmmm 5 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3361

    jeremymatter
    Participant
    Post count: 25

    Hello, I was wondering if it is possible to have an autocomplete functionnality when using the tags field in frontent post publishing?

    I have read that WordPress have a built-in tag auto complete script, but no idea how to use it for the front end link

    #3393

    Tareq Hasan
    Keymaster
    Post count: 2831

    There's lots of ways it can be accomplished ๐Ÿ™‚

    #3557

    jeremymatter
    Participant
    Post count: 25

    Thank you a lot for your answer, I will go through the documentation!

    Cheers!

    #3652

    kolhoffmmm
    Participant
    Post count: 10

    Your tag functionality for custom tags does not work. I get it working with a drop down, but it means you can not create new tags. and even with the drop down it does not work it some how allocates an id as the custom tag and creates a tag like that

    ninja forms is having a solution where it seems to be working

    http://demo.wpninjas.com/ninja-forms/post-creation/

    #3654

    jeremymatter
    Participant
    Post count: 25

    For my use, I finally didn't need to have the autocomplete functionnality on the tag field (and it worked only for 1 tag after a quick test), but work very fine with a text field :

    <script>
        jQuery(document).ready(function($) {
            var availableTags = [
    	<?php
    	    $recentPosts = new WP_Query();
    	    $recentPosts->query('showposts=100');
    	    while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
    	    "<?php echo get_post_meta( $post->ID, 'marque', true ); ?>",
    	    <?php endwhile; ?>
    	];
    
    	$( "#marque" ).autocomplete({
    	    source: availableTags
    	});
    });
    	</script>
    #3658

    kolhoffmmm
    Participant
    Post count: 10

    and how do you save it into tag form afterwards ?

    #3662

    jeremymatter
    Participant
    Post count: 25

    The id #marque is “connected” to the id of your field, afer you only have tu do a query to retrieve the tags and format them according to the syntax example of the autocomplete jQuery plugin,

    #3663

    kolhoffmmm
    Participant
    Post count: 10

    What I actually mean is how do you save it as a proper taxonomy afterward in wordpress. so it is availabe as a non hierarchical taxonomy

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Tags autocomplete in frontend post form?’ is closed to new replies.