Ticket #5172 (assigned enhancement)

Opened 1 year ago

Last modified 9 months ago

Adding classes to wp_generate_tag_cloud

Reported by: chmac Assigned to: westi (accepted)
Priority: normal Milestone: 2.9
Component: Template Version:
Severity: normal Keywords: wp_generate_tag_cloudk, wp_tag_cloud, has-patch
Cc:

Description

The attached patch changes 2 things on the wp_generate_tag_cloud function.

1) The current code uses single quotes instead of double quotes, I believe the standard is to use double quotes. I've converted single quotes to double quotes.

2) I've rounded the tag size to a whole number (no decimal places).

3) I've added a class "tag-cloud-item-X" where X is the number in the list and a second class "tag-cloud-size-X" where X is the size of the tag. . This will allow theme designers to apply different styles to tags. For example changing the colour from cold to hot depending on order or size.

Attachments

category-template.php.diff (1.0 kB) - added by chmac on 10/09/07 17:09:52.

Change History

10/09/07 17:09:52 changed by chmac

  • attachment category-template.php.diff added.

10/09/07 17:46:09 changed by foolswisdom

  • keywords changed from wp_generate_tag_cloudk, wp_tag_cloud to wp_generate_tag_cloudk, wp_tag_cloud, has-patch.

10/09/07 17:55:28 changed by markjaquith

There is no standard for quotes style in XHTML. We tend to use doublequotes by default, but we'll use singlequotes if we want to concat in some variables.

e.g.

echo "<a href='$url'>$title</a>";

rather than:

echo '<a href="'. $url . '">' . $title . '</a>';

10/09/07 18:55:04 changed by westi

  • owner changed from anonymous to westi.
  • status changed from new to assigned.

+1 Good plan to add more classes for styling.

Relates to #5131 and #5171 all tag cloud changes.

I will get these all in soon.

01/22/08 18:18:47 changed by AaronCampbell

+1 for adding some classes

I think we should actually remove the inline styles (font-size) and use classes instead.
Also, while we're adding classes, I think we should add a current_tag class if you're viewing a tag page.

03/19/08 23:45:15 changed by ffemtcj

  • milestone changed from 2.5 to 2.6.