[wp-trac] [WordPress Trac] #6504: wp_tag_cloud default unit output
(undefined styling / solution)
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 31 16:08:00 GMT 2008
#6504: wp_tag_cloud default unit output (undefined styling / solution)
----------------------------+-----------------------------------------------
Reporter: vlogtheimpaler | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.5.1
Component: Template | Version:
Severity: normal | Keywords: wp_tag_cloud
----------------------------+-----------------------------------------------
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.
--
Ticket URL: <http://trac.wordpress.org/ticket/6504>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list