Select the template on which you want to add the following code to index.htm on the first page:
1. select the template on which you want to add the following code to index.htm on the first page.
The code is as follows:
-
Tags tag cloud
-
{Dede: tag row = '45' getall = '1' sort = 'Hot '}
[Field: tag/]
{/Dede: tag}
2. add the following functions to/include/common. func. php.
Function getTagStyle ()
{
$ MinFontSize = 8; // minimum font size, which can be changed as needed
$ MaxFontSize = 18; // maximum font size, which can be changed as needed
Return 'font-size :'. ($ minFontSize + lcg_value () * (abs ($ maxFontSize-$ minFontSize ))). 'px; color :#'. dechbx (rand (0,255 )). dechbx (rand (0,196 )). dechex (rand (0,255 ));
}
This function outputs random styles, including font-size and color.
If you want to specify only a few font sizes, instead of being completely random, change the above function code:
Function getTagStyle ()
{
$ Sizearray = array ('8', '9', '10', '11', '12', '20'); // customize the font size, can be modified as needed
Return 'font-size :'. $ sizearray [rand (0, count ($ sizearray)]. 'Pt; color :#'. dechbx (rand (0,255 )). dechbx (rand (0,196 )). dechex (rand (0,255 ));
}
3. generate the following to see the effect!
Finally, let's take a look: