Mar03
I was looking for a way to limit the number of posts that came up on some page (doesn’t matter what: home, archive,…) and found this page by Justing Blanton. Justin notes that there is a way to do this in the admin section of Wordpress. But we like to do this on a particular page, not all pages. Now I don’t doubt his solution works. I just knew I had done this already differently on one of my sites, but I was too lazy to open up the folder on my computer that contained the file. The browser window was open so I typed a few words hoping to find the answer faster than opening the files of that site. That’s how I found Justin’s solution.
The solution I used was a bit different though, so I’ll post it here for those interested (yes I did have to look it up in my site folder in the end). You probably know the loop. If not, here’s the link to the codex page explaining it. What I did was just put something like this in front of it:
<?php query_posts(’showposts=7′); ?>
Put this in front of the start of the loop (in front of if ( have_posts() ) ), and the number of posts will be limited to seven. You can adjust the result a bit if you want to vary the number of posts depending on where you are. For example, if you like to limit the number of posts only on the frontpage, you might change this to:
<?php if (is_home()) { query_posts(’showposts=7′); } ?>
For a further explanation of query_posts, I will point you to the relevant codex page.
Mar02
Mp3 must be the most widely used audio format. But it is not without its problems. Especially not so for open-source advocates. See, mp3 is 1) closed-source and 2) demands royalty for implementation. Want to know how much they ask? Look here for an answer. See how much it would cost for let’s say a linux distribution that wants to inlcude an mp3 codec so people can play their mp3 music files? I wouldn’t want to distribute one with 100.000 users downloading it. Big companies can afford this, but for almost everyone else this isn’t feasible.
But there is something you can do about this, and so help open-source initiatives. The answer is an open-source audio format know as Ogg Vorbis. What is this? Let’s quote their FAQ:
Ogg Vorbis is a new audio compression format. It is roughly comparable to other formats used to store and play digital music, such as MP3, VQF, AAC, and other digital audio formats. It is different from these other formats because it is completely free, open, and unpatented.
If you read their FAQ you will also find other benefits (such as smaller size) besides it being open-source.
But if you rip your CD’s, they are automatically converted to mp3, right? Not necessarily. There Vorbis site lists software for commons operating systems to play and rip your CD’s to the Ogg Vorbiss format, straight into .ogg files that is. There is also software listed there to convert already existing .mp3 files to .ogg format. One that isn’t listed for linux on the site is “audio convert“.
So actually there is no reason not to start using .ogg files instead of .mp3. And why not encourage your friends to do the same?
edit: I stand corrected: “Ogg is a container format, Vorbis is an audio codec.”