Opened 16 years ago
Closed 15 years ago
#6504 closed defect (bug) (duplicate)
wp_tag_cloud default unit output (undefined styling / solution)
Reported by: | vlogtheimpaler | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5 |
Component: | Template | Keywords: | wp_tag_cloud |
Focuses: | Cc: |
Description
I found a possibly unwanted behavior when attempting to dump the inline styles for wp_tag_cloud in one of my current "themes-in-progress". Mainly when the size arguments were left undefined:
wp_tag_cloud('smallest=&largest=&unit=&number=0&orderby=count&format=list');
All the units in this example default to '0', which hides listed tags all together via the inline styles. It seems to apply to lesser-used tags the most as I don't have a sample DB with tons of tags yet to test against. But it could be used to solve a problem at the same time.
I believe that instead of creating a whole new template tag or plug-in, wouldn't it be more useful to just use this as a valid argument to exclude inline styles? This way if units or min/max sizes (or all three as above) are left undefined, wp_tag_cloud can display tags exactly like wp_list_categories for those who don't want inline styles. It may also work some ideas from ticket #5172 if strings could be passed to define class names instead of units.
so something like:
wp_tag_cloud('&unit=0&number=0&orderby=count&format=list'); /* 'unit=&' or 'unit=0& */
could simply exclude inline styles all together where as:
wp_tag_cloud('unit=class&class=xsm,sm,md,lg,xl,xxl&number=0&orderby=count&format=list');
would define the unit type as classes. Then divide the counted number of classes appropriately to be treated as numbered units while pushing class names as numbers.
If there's a plug-in that already does all of this, I haven't found it. But it would be so much easier to have it as a built-in template tag to flexibly display all tags.
Since nobody has picked this one up yet. I figured I may add that it also might prove useful if you could also output a plain list for use as meta tag keywords.