//随机标签颜色
function tagsrandom(){
    $sjbg =array(
       "1" => "badge badge-pill blue",
       "2"=>"badge badge-pill red",
       "3"=>"badge badge-pill pink",
       "4"=>"badge badge-pill orange",
       "5"=>"badge badge-pill yellow",
       "6"=>"badge badge-pill green",
       "7"=>"badge badge-pill teal",
       "8"=>"badge badge-pill cyan",    
        );
        shuffle($sjbg);
        echo array_shift($sjbg);

}

Insert the above code in function

Put the following code where you need to implement it

<div class="col-md-2 mx-auto">
            <h5 class="text-uppercase font-weight-bold mb-4">标 签 云</h5>
            <div class="footer-tags">

                <?php $this->widget('Widget_Metas_Tag_Cloud',array('limit' => 15))->to($tags);  ?>  
                <?php while($tags->next()): ?>  
                <li><a rel="tag" class="<?php tagsrandom();?>" href="<?php $tags->permalink(); ?>"><?php $tags->name(); ?></a></li>
                <?php endwhile; ?>
            </div>
        </div>

Poor technology will only achieve this, slowly learning, take notes

Then style words need to write themselves! That's for reference, but you can also pick mine

You know, I don't have to do it all.

Last modification:May 10th, 2023 at 01:10 pm
If you think my article is useful to you, please feel free to appreciate