WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#5171 closed enhancement (duplicate)

Add parameters to "tag_cloud()" to bypass size variation, and to show frequency counts

Reported by: brh Owned by: westi
Milestone: Priority: normal
Severity: normal Version:
Component: Template Keywords: needs-patch
Focuses: Cc:

Description

I wanted to display a "tag cloud" using the tag_cloud() tag, but without any inline font-size tags, and with the frequency of the tag displayed beside the tag (like it can be with categories). You can see an example at http://brh.numbera.com/blog/. To do this I added the "varysize" and "showcounts" parameters to the tag.

Attachments (1)

category-template.php.diff (1.6 KB) - added by brh 7 years ago.
Patch against trunk (rev. 6206) to add these two parameters

Download all attachments as: .zip

Change History (11)

brh7 years ago

Patch against trunk (rev. 6206) to add these two parameters

comment:1 foolswisdom7 years ago

  • Milestone set to 2.4

comment:2 westi7 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

Accepting Ticket - I will review this and checkin.

comment:3 westi7 years ago

Note to self - See also #5131 and #5172

comment:4 Otto427 years ago

I think the whole tag cloud function might need a rethink here. This is the first tag cloud function I've seen using inline styles instead of simply assigning weight and ID classes. Inline styles are generally bad form, and move presentation out of the theme and into the core, which is the wrong way to go.

I propose getting rid of the inline styles entirely, and adding some styles to the bundled themes, so as to show how it's done. I suggest tag-cloud-weight-X and tag-cloud-id-X classes.

Yeah, it'll break some things. So deprecate for a version if you feel it's needed, but 2.4 should clean this up a bit and ditch the style="whatever" entirely from the tag cloud.

comment:5 AaronCampbell6 years ago

+1 for the inline styles being a bad idea

comment:6 ffemtcj6 years ago

  • Milestone changed from 2.5 to 2.6

comment:7 follow-up: brh5 years ago

  • Milestone changed from 2.9 to 2.8

Any chance this could get fixed for 2.8 or 2.7.1? I was disappointed to see that the inline styles are still there in 2.7.

comment:8 in reply to: ↑ 7 FFEMTcJ5 years ago

Replying to brh:

Any chance this could get fixed for 2.8 or 2.7.1? I was disappointed to see that the inline styles are still there in 2.7.

Is the patch still valid?

comment:9 Denis-de-Bernardy5 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.8 to Future Release

broken patch

comment:10 Denis-de-Bernardy5 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

see #5172

Note: See TracTickets for help on using tickets.