Where the Moblog?
I decided that moblog postings — those made from my phone and usually containing little to no text — will look better if they’re taken out of the usual run of the site’s layout and put on their own page. To that end, I’ve added a link to the moblog up above in the menu area, added a little widget to display my most recent few moblog posts over in the sidebar, and retained the ability to see those posts by clicking on the Category link or in the by-date archives.
One nice thing is that I can now come up with a new template just for moblog entries, if I decide that would be fun. So far, meh. Maybe later.
For now, I just hardcoded everything and inlined the code changes, but perhaps going forward I can package the changes into a plugin. Here’s what I had to do:
- In my theme’s index.php, before the Loop, I added
<?php if (is_home()) { query_posts("cat=-16"); } ?>…to exclude my category 16 posts from the results of a request for a list of posts when such a request comes from the main page. - In sidebar.php, I added to the main unordered list the following item:
<li><h2><?php _e('Recent Moblog Activity') ?> </h2> <ul> <?php global $post; $myposts = get_posts('numberposts=3&category=16'); foreach($myposts as $post) : setup_postdata($post); ?><li><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a> (<?php the_time('d M'); ?>)</li> <?php endforeach; ?> <li><a href="<?php echo get_category_link(16);?>">more... </a></li> </ul> </li>…which displays the titles (linked) and dates of the last three moblog postings. - In xmlrpc.php, I added, at line 559:
else { $post_category[0] = 16; }…to work around Flickr’s inability to populate the category field of the Metaweblog API structure, by providing a default category. - And finally, in header.php, I added to the list#hmenu:
<li class="hmenu1"><a href=" <?php echo get_category_link(16);?>"> Moblog</a></li>


Mike Sheehan:
Hey, the creative commons license doesn’t say you can call my dog ugly.
12 August 2008, 7:21 amColin:
He’s so ugly that it wraps around to completely adorable. I wish I could say the same for my moblog posts.
19 September 2008, 2:01 pm