Limit Characters for Tags (1 post)

  1. dadaas
    Posted 5 years ago #

    i have real trouble with tags, i see huge tags generated by autotaging plugin. So i dont like to display tags longer than 30 characters.

    I have this code to disoplay tags on template:

    <?php $posttags = get_the_tags();
    if ($posttags) {
    	foreach($posttags as $tag) {
    		echo '<a href="'.get_tag_link($tag->term_id).'">'.$tag->name.'</a> ';
    		if( $count >12) break;
    else print '<span>'.__('none', 'Eos').'</span>'; ?></span><?php endif; ?>

    Please if anyone knows how to adjust this code and implement that characters longer than 30 are not displayed. Or if you know the way to forbid collecting the tags that are longer than 30 in first place, please help me.


Topic Closed

This topic has been closed to new replies.

About this Topic