Skip to:
Content
Pages
Categories
Search
Top
Bottom

Tag length

  • Avatar of James
    James
    Participant

    @janismo

    hi,

    does any one know some way to limit length of posts tags?
    found code below to limit number of tags, maybe it can be updated/changed?

    thanks!!

    `<?php
    $posttags = get_the_tags();
    $count=0;
    if ($posttags) {
    foreach($posttags as $tag) {
    $count++;
    echo ‘term_id).’”>’.$tag->name.’ ‘;
    if( $count >4 ) break;
    }
    }

    ?>`

You must be logged in to reply to this topic.