How to display and use all existing tags at my write-post-at-frontend-panel?

try something like this:

<?php
$taxonomies = array( 
    'wissen_tags'
);
$args = array(
    'orderby' => 'name',
    'order' => 'ASC',
    'hide_empty' => false
);

$terms = get_terms($taxonomies,$args);

if (count($terms) > 0):
i = 0;
    foreach ($terms as $term): ?>
        <div class="wissen_tag_list">
            <input type="radio" value="<?php echo $term->term_id; ?>" name="wissen_tags" class="wissen_tag_list_ckb" <?php if ( $i == 0 ) { ?>checked<?php } ?>>
            <label class="wissen_tag_list_ckbl">
                <?php echo $term->name; ?>
            </label>
        </div>
<?php
    $i++; endforeach;
endif; ?>

Of course if you have many tags you might consider a more dynamic approach, e.g. by ajaxifing a input; and not showing the complete list always.

note:
→ you probably have to make above code fit your criteria/parameters better, not sure if I caught them all correctly;
→ additionally, above code is for selecting a single term;


edit: for multiple selections

  • change type to checkbox;
  • and make name – respectively the according $_POST variable – an array;

<input type="checkbox" value="<?php echo $term->term_id; ?>" name="wissen_tags[]" class="wissen_tag_list_ckb">

Leave a Comment