Category Archives: Wordpress

Limiting Categories in WordPress

Bren and I are working to setup a news/announcement blog at work. This blog will have multiple authors, and most of the authors will only post to one or two categories each. There might be some overlap of categories.

Following the logic of the Principle of Least Privilege — plus having a healthy dose of trust that user error will happen no matter what — I set out to make PLP a reality in limiting what categories authors can post to. By default with WordPress, every author can post to every category. Redalt has two plugins that get you on your way.

The first is Role Manager. Role Manager allows you to define 37 different settings, from the ability to upload files, edit others posts, manage categories, switch themes, and on. And you can create however many roles you need. The Redalt version works for WP2.0, but this modified version works with WP2.0 and 2.1.

The second plugin is aptly named Limit Categories. Limit Categories picks up where Role Manager leaves off. Based on the user’s role — those roles created by Role Manager and the five default roles — you can specify what categories they can post to, as well as what their default category is. And like Role Manager, the Redalt version works for WP2.0, but a modified version for WP2.0 and WP2.1 is available here.

If you are inclined to do a “Free For All Friday” this is exactly the setup you’d want to use. Who knows, I might just do that around here sometime.

Add Digg It Badge to WordPress

I just recently added the Digg It buttons on here. I had to do some debugging to try to get it to work properly, so I figured I’d pass along my work for anyone else to use. There are two things that I did to make it work right:

  1. Modify the posts loop on the template pages I wanted the badge to appear on. In my case this was the index.php, single.php, and page.php templates.
  2. I encapsulated the Digg code in a DIV so I could style it up.

This snippet of code below is what you will want to put in your posts loop, right above the <?php the_content(); ?> function call. I chose to include the digg_url and digg_title JavaScript variables.

The digg_url variable is required if you are going to place the badge in your index.php template, or any template where it is possible to see multiple posts e.g. archives.php. What it does is encodes each badge with the permalink for the appropriate post, rather than using the URL of the page you are currently viewing. I decided to include digg_url on single.php and page.php for consistency. The digg_title variable pre-populates the Story Title field for the first person to Digg the post.

<div class="diggit"><script type="text/javascript">
digg_url = '<?php the_permalink() ?>';
digg_title = '<?php the_title(); ?>';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>
<?php the_content(); ?>

Now for the CSS stuff. For my template I only needed to float the DIV to one side — I chose left — and modify the padding options to get it in position.

.entry .diggit {
float:left;
padding: 20px 5px 0 0;
}

The general information for this came from the Digg Tools Integration section. I added in the necessary WordPress PHP functions in order to fill in the JavaScript variables. Try it out and let me know how it goes.

WordPress Reporting With a Side of Noodles

I’ve been following Joe Tan‘s plugin development for WordPress for quite a while. I initially checked his stuff out for his Flickr Photo Album plugin, but found my favorite plugin of all-time (behind SpamKarma2 of course): Google Analytics and Feedburner Reports.

Obviously this plugin only benefits you if you use Google Analytics and Feedburner on your blog. Since both are free I don’t know why anyone wouldn’t use them. A nice side benefit is that you don’t have to visit those two sites for an overview of your statistics anymore.

The plugin adds a new menu to your WordPress admin panel which shows an array of dashboard-type reports. With the latest version of the plugin Joe added three new report options: Rising Sources, Rising Content, and Falling Content. Add those to the other nine reports and you have yourself a one-stop-shop for blog statistics.

Oh, I almost forgot. This plugin will also enter the necessary code for Google Analytics into your blog, including what’s needed to track outbound links. Try this plugin out. You definitely won’t regret it.

News Blog at Work (and RSS)

This is the third of a three-part series on Web 2.0 at Work.

I saved this one for last because I was just in a meeting on Friday of last week to discuss this exact topic. The issue of internal communication has been a recognized problem where I work, not only among the employees of the university, but also between the employees and the students.

A few months back an Executive Assistant on campus started sending out general administrative news emails, calling them E-nnouncements. She would send these out every Monday morning, and those emails were incredibly long, featuring at a minimum of ten 1-3 paragraph news type entries. Early on I was thinking that this would fit perfectly into a blog format. Apparently Bren did to, as he and IT helped the EA get a blog setup just for this purpose.

Because the E-nnouncements tended to be focused around traditional undergraduate population of the university, and Bren works with a different population, he started thinking about mirroring the blog setup for his population group. This is what led us to the meeting last Friday. The obvious fear was of blog-bloat. The decision we came to was to have one central blog for all administrative news, and by using some plugins to WordPress we will be able to section out the content to focus it for each of the major populations on all of our campuses.

The way that RSS comes into the picture is what we are doing to leverage some of the great capabilities that are out there. First, we are pushing a full feed and category specific feeds out through Feedburner. One of the biggest benefits of having Feedburner behind the feed is that people can choose to subscribe via their feed reader or they can subscribe via a daily digest email. So, for all those people that don’t know what this are-es-es thing is, they can add on to their already full email inbox.

Beyond Feedburner, though, now that this news is in a friendly RSS format there are an unlimited number of places this content could be placed. We have a portal where students and staff can complete administrative tasks (register for classes, complete university forms, etc.). We will push the feeds to the portal for students to see there. If your company has an intranet, this is the same type of thing.

Blogging is not just about sharing your personal ramblings and opinions anymore. The only difference between what we know as blogging and an E-nnouncements type blog is the message you are trying to convey. That, and maybe the ability to leave comments. A company news blog is a great way to get news out to the employees. Try to get some department heads, or even some executives, to buy in and write a monthly “From the Desk of…” type bit.

A note on WordPress and category feeds. If you are using the “Date and name based” permalink option, you can get a specific category feed with the url of http://your-blog/category-slug/feed/. That simple. And as we are doing, you can feed that to Feedburner to get all the tricks they offer, too.

Team Blogging at Work

This is the first of a three-part series on Web 2.0 at Work.

As Tim figured out, I work in a university admissions office with Bren. Being in the sales business there are two general types of staff: those that sell (recruit) and travel, and those that support (file coordinator, visit/event staff) the sales team.

The major traveling season for our admissions counselors is in the Fall, generally mid-September through November. They will do other short trips during the Spring, but nothing like the constant travel of the Fall. One thing we’ve always had trouble with is making everyone feel connected during these times. We’ve relied on email and phone calls in the past, but that tended to be disjointed and not consistent.

This year we decided to take a different path. I knew that our IT department was setting up some WordPress blogs for other internal uses, so I had them set one up for us. I created a couple of posts of a HOWTO nature to help them understand the basics of authoring a post in WordPress, but then we let them go at it with the knowledge that this was going to be our keep-in-touch place.

This was major success for us. We heard about the northern lights in Alaska, and how B&B’s ask you if you want to be woken up to see them. Even got some photos from that one. We heard stories about some of the more “colorful” parents that were met. We had a contest going to see who found the cheapest gas. One counselor liked his rental car so much he blogged about it :-)

It wasn’t all on the traveling side, however. We started posting the meeting minutes from our bi-weekly staff meetings. Photos to document that we actually celebrated Bosses Day. Props given to staff for stepping up when there was a major need in the office. Even news and photos of the twins just born to a recently-departed co-worker.

We still post things out there even though travel season is over, we just don’t do it with the same frequency.

One thing that was a bit of an unspoken ground rule was that the blog needed to be fairly work related. This was not a space for people to randomly talk about whatever they wanted. Before you embark on your own “office blog” make sure you have your ground rules laid out. A work blog is not a place to talk about your partying from the weekend.

Lots of WordPress Plugins

Lorelle, over at Lorelle on WordPress, is doing a bangup job so far in her Month of WordPress Plugins. I’ve been happy to see some of my favorite plugins featured already. I’m even finding some new types of plugins that I’m wondering how I’ve made it without them.

This is a great series. Rather than focusing on only one plugin a day — the easy thing I would have done — she’s featuring a whole category of plugins a day. Categories featured so far include “Battling Evil,“, statistics, and widgets. Stay tuned to this, as I’m sure you’ll find some great new plugins, too.