Making a featured tags section
I’ve gotten a few questions about this, so I’m going to explain how I’m putting together the featured tags section on my (still in progress/yet to be released) dashboard inspired theme.
This uses JS with v1 of the API, the HasPages block in the theme HTML, and some CSS.
Instead of relying on text options for tags, this theme is grabbing pages based on if it is a tag url or not.
While I technically have 4 links here, /About is not a link to a tag, so it gets removed.
This uses the API similar to how @fukuo did featured posts, but with vanilla JS instead of jQuery.
How it works:
- Select only the links in the featured tags container that include /tagged/ (using a CSS attribute selector for [href*=“/tagged”])
- Grab the tag name from the url
- Add that tag name to the API url
- Use the returned data to add the text, total posts, and any images from the most recent result of that tag
- Style/formatting with CSS
I have the JS and CSS here with some comments on what everything is doing so far. I will update this as I make more progress on the theme, so let me know if you run into anything that I need to update!










