Currently Browsing php

Write Your Own Related Posts Plugin

My previous post on writing a simple related posts plugin was a popular one, and one reader wanted to take it further for a website he was working on. Well it was painfully obvious that my example was inadequate for doing any sort of fun stuff so I started adding bits and pieces to create a more robust widget. If you haven’t already, you might want to read the first post to get caught up.

This isn’t a true “plugin” in the sense you can activate it in Wordpress, but more of a widget you can plug into your theme. This widget is going to grab posts based on tags and return specific info from the matching posts. This will be a good chance to see some of the guts of Wordpress being used and how you might use them for your own projects.
Continue Reading

Simple Related Posts Widget for Wordpress

When I started building wordpress themes PHP and most of the advanced wordpress functions went over my head. I’ve learned quite a bit since then, but one step taught me a lot about wordpress and PHP. While I was coding my premium wordpress theme I decided to make a very simple related posts widget. There are plenty of plugins that do this but I wanted to learn about writing widgets and further my PHP and I had a pretty good idea on how to do it, so I did it.

Functions.php

I suspect most people creating themes never even create a functions file, much less know what it does. Used correctly it can be a very powerful tool. This is how advanced theme authors Continue Reading