Creating a Chart on Your WordPress Archives Page

chart

One part of WordPress that I’ve never been overly impressed with is archives. This isn’t so much a WordPress problem as it an archive problem, archives are inherently boring. As a result of this revelation I’ve spent some time thinking up new ways to present the information. My latest idea was adding charts to represent some of the data from the archives. This is a fairly simple function to output the info and style it as a chart.
If you want to use a flash or javascript chart, scroll to the bottom for a different function.

The Chart
After looking for a lightweight flash or javascript charting solution, I decided for an archives page just plain CSS charts would be the way to go at first. So the output we are going for is something like this:

<dl class="barGraph 2008">
<dt style="" class="label"><a href="">Jun</a></dt>
<dd title="Jun" style="height: 200px;" class="bar Jun">6</dd>…

You Might Also Like...

  • List Posts by Category In Navigation

    55 readersWordPress is primarily a blog platform. Not infrequently it is used as a CMS. But not just static pages play a role, but also posts, because they are giving more opportunities, having better performance and be published in feeds. Therefore, I prefer to use, in the context of WP as a CMS, posts more than

  • How to Create a Comments Central Page Template in WordPress

    295 readersOne way to increase visitor engagements is to reward their comments by showcasing them on your website. Additionally, you can also feature the top commenters as well, linking back to their website in the process. Here we’ll create a dedicated Page Template to display those comments and commenters in one place. In short, this tutorial

  • Add Classes to post_class

    1995 readersThe post_class() function in WordPress is pretty darn useful. It is used like this, in most templates, in a wrapping div of all the content you are outputting: <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <!-- Post stuff --> </div> I was in a circumstance where I wanted to add an additional class to what that

  • Call a Widget with a Shortcode

    1723 readersWe covered how to run a shortcode in a widget. But what about inserting a widget with a shortcode? I recently had this situation come up. I had a single page where I just wanted to be able to chuck in a widget without the whole rigmarole of creating a special widgetized area and probably

  • Add a Widgetized Footer to Your WordPress Theme

    197 readersThe inspiration for this tutorial comes from a tweet I received with feedback for the soon-to-be-released RS12 theme. Although the widgetized footer did not ultimately make it in the release of the RS12 theme, I decided to write this tutorial to show people how exactly to add a widgetized footer in your theme. In this

  • Declare Multiple Widgetized Areas

    1850 readersHave a bunch of different areas you wish to declare as a widgetized area? Save repetative code by creating a quick array of their names, then loop through that array calling the register_sidebar() function on each one. Elementary PHP stuff here, but hey, it just saved me quite a few lines of code in a

  • How to: Offsets and Paging

    325 readersReader John writes in: How does one use paging with an offset? Doing so breaks the navigation controls. The problem with using an offset in a query is that WordPress ignores any reference to paging. In other words, you can use an offset and paging, but not both together. This can be solved by tapping

  • Rounded Font-Sizes (with Colors!) for Tag Clouds

    1761 readersTag clouds accomplish their varied font sizes by applying inline styling to each tag. The resulting font sizes can be really weird like style='font-size:29.3947354754px;'. There is nothing inherently wrong about that, but it feels a bit unsettling and less controllable. Mike Summers sent in a solution he uses on his own site. Let’s check it

  • Display Upcoming Entries In Your Post With A WordPress Shortcode

    968 readersSince some days several contacts have been considering the option to display upcoming posts on their site. WordPress offers a really simple solution for this in the form of the attribute post_status. The post_status is stored in the wp_post table and has generally the attributes: draft, private, publish or static for pages. There is one

  • Display most recent comments with Gravatar

    1523 readersIs your blog popular? Do you got receive lots of comments from your readers? If yes, what about displaying the most recent comments in your blog sidebar (or elsewhere) to let your visitors knowing about the discussion?Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!Display