Fork me on GitHub
Nation Pigeon

Site Update 21-Alpha

8th August 12 | Tags: , , , , ,

Surprise, a new shiny theme has appeared!

I have spent the past few days working on the design you currently see. It is based on the previous theme which I have been using for the past two years or so. A big thank you to Ulysses for creating the original theme. I have put a little link in the footer for you. Although my recreation of Ulysses’s theme is not of the same quality, I believe it has some potential.

As some form of thank you to the open source community, which I rely on every single day, I have released the source under GPLv3. So if you feel it would look better with X or a little less of Y, then get on GitHub and fork it. I plan to continue tweaking, adding and removing bits. Once I’m happy with it I shall put it in the WordPress Theme archive. I also need to get around to writing up an about page.

Some of my favorite bits are:

  • Syntax highlighter
  • Widget sidebar
  • JQuery toggle bit

I have tidied up some posts and sorted out some categories. You might notice a new category called ‘Systemless’ this will house posts which don’t fit in to any specific area. Also depending on how good your display is, you’ll notice that the nation pigeon banner at the top has a black background and stands out, fortunately my display is not great and I can’t see it, but the .psd file exists. Check out the new banner post.

Break Down

I will now cover some of the best bits of the theme and how they were achieved.

The top section of the site shows the latest five posts from three categories.

 
<h1>Programming</h1>
<ul>
<?php $my_query = new WP_Query('cat=11&showposts=5'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" title="Permanent Link to: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>

The above code snippet shows exactly how it is done. The WordPress Codex has a lot of information regarding this sort of thing. But the most useful page I found was this one which explains how WordPress’s loop works. Note, because these are outside the main loop, you have to create your own loop query and iterate though it.
Further down that page it also explains how to work with multiple loops, this is how it is possible to display the latest post in full, rather than just the excerpt.

The snippet below shows the JQuery toggle sliders. This will later be replaced with a CSS image instead of text. This will prevent the juddering.

<div id="morebutton">MORE</div>
<!-- Show/Hide More -->
<script type="text/javascript">
$("#morebutton").click(function () {
var target = $(this);
$("#more").slideToggle('slow', function() {
target .text((target.text() == "MORE")?"LESS":"MORE") // Thanks Flabby.
});
});
</script>

I really like my search box, it will only clear when you want it to and won’t clear when you have text in it. I often find sites which have an annoying tendency to clear anything entered in the form.

<input type="text" name="s" id="quicksearch" 
value="<?php echo (is_search() ? the_search_query() : '   Search'); ?>" 
onclick="if(this.value=='   Search')this.value='';" 
onblur="if(this.value=='')this.value='   Search';" />

That’s about it on the fanciness of the design.

Categories: Systemless

3 Responses to “Site Update 21-Alpha”

  1. F. Rabbit says:

    I am liking the new theme (although the last one was awesome).

    My two tiny suggestions are: make the more/less link have cursor: pointer. Secondly the top three boxes seem a little empty, maybe taking a bit of the spacing out below the links?

    • Pete says:

      Done the mouse pointer.
      The spacing at the top is a bit more tricky.

      If I have posts with long titles, it has a tendency to extend out site of the box. I could do with some sort of auto align.

      Thanks for the pointers ^_^

  2. My programmer is trying to persuade me to move to .net from
    PHP. I have always disliked the idea because of
    the expenses. But he’s tryiong none the less. I’ve been using WordPress on a number of websites
    for about a year and am nervous about switching to another platform.
    I have heard excellent things about blogengine.
    net. Is there a way I can import all my wordpress content into it?
    Any kind of help would be really appreciated!

Leave a Reply

Copyright © 2007 ∞ Nation Pigeon - Designed by Peter Mayanrd
Theme Based on Black-Green - Fork it on GitHub