Mini Posts on JordanH.net!
I really like the idea of Mini-Posts on blogs. I’m a regular reader of Matt’s blog and he uses mini-posts all the time. Nope, there’s no plugin involved, nor any PHP-file edits needed. Just a few template changes. Below I’ll show you how to implement mini-posts for your own blog.
Step One
First, you need to make a category for your mini-posts. On JordanH.net, the category is called Mini-Posts. Any mini-posts you make need to be posted in this category. Remember the ID number of the category - you will need it in the next step.
Step Two
Now, open up the Main Index Template file and then add this code just at the beginning of the loop. Remember to substitute the category ID number in the highlighted place:
<?php if (in_category(CATEGORY_ID) && !$single) { ?>
<div class="entry"><div class="post" id="post-<?php the_ID(); ?>">
<?php echo $wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
echo ' '; comments_popup_link('(0)', '(1)', '(%)')?> <?php edit_post_link('(e)'); ?></div></div>
<?php } else { ?>
Before the close of the loop, add a ending brace.
Now replace the CATEGORY_ID with your category ID from earlier. You may want to adapt the template changes to reflect your template classes etc. The reason we use an SQL query to get the contents of the post, is to stop WordPress automatically adding paragraph tags around the post text (which is good for normal posts, but adds extra whitespace on mini-posts).
Step Three
Now try posting a post in the category, and it should show up on your blog as a mini post. It still has the comments/permalink functionality, try clicking the (0) link next to the post to view all the comments and the permalink. These will also show up in your RSS Feed.
Hope this helps! If anybody has a way of doing this more easily (especially the SQL query, is there a function for that?), leave a comment!
Tags: php, wordpressThe Apprentice
Series Four of the popular TV show The Apprentice has been on our screens for almost ten weeks! It’s always a great laugh watching Alan Sugar having a go at the candidates when they mess up. I’m quite glad that Jenny went out last week though! Anyway, this week they have to sell wedding items at the NEC in Birmingham. I hope that they do a television shopping channel task like the last series, although I still can’t see a clear winner out of all of the candidates.
What do you think? Let me know, feel free to drop a comment.
>Jordan
Tags: Photos, the apprentice, tvThe Riverdance in Blackpool
I don’t know how many of you were watching the news in late January and early February, when a ship called the Riverdance ran aground off the shore of Cleveleys, near Blackpool. I went shortly after that, and got some pictures of the ship and the masses of people who turned out to see the stricken ship.
I’ve finally got round to uploading those photos to Flickr. I’ve put them all up in a set on Flickr for you to look at. Feel free to comment on them there or here.
>Jordan
Tags: flickr, Photos, riverdance, seaVisit to All Saints Church
I went here with school yesterday (Monday). The purpose of the trip was to get some sketches and pictures of All Saints Church (in Hesketh Bank), for the Art project we are currently working on - Architecture. And I sure did get some pictures - about 80 of them! I’ve uploaded about 60 to Flickr, so see my photo set for the full lot.
Let me know what you think by adding a comment.
>Jordan
Tags: all saints, church, hesketh bank, School

