Archive for March, 2009

Listing Child pages with Excerpt

For those of you who use Wordpress as a CMS, I found myself searching for a way to list several related pages with an excerpt.  I read through this article by The Wordpress Guru, and found that it basically described what I wanted to do, however it used calls to the database that I didn’t feel was the best way to do it.  Wordpress should have something built in to do this, right?  Right.

My searches through the Wordpress Codex left me a little overwhelmed.  I could list all pages using get_children(), but if I tried to retrieve the title or excerpt it would only retrieve the parent posts data.  So after a little more searching and testing I found the best way, that I know of, to do this:
<?php
// Set up the arguments for retrieving the pages
$args = array(
    'post_type' => 'page',
    'numberposts' => -1,
    'post_status' => null,
// $post->ID gets the ID of the current page
'post_parent' => $post->ID,

    'order' => ASC,
    'orderby' => title

    );
 $subpages = get_posts($args);
 // Just another Wordpress Loop
 foreach($subpages as $post) :
    setup_postdata($post);
 ?>
<h4><a href="<?php the_permalink(); ?>"
id="post-<?php the_ID(); ?>">
<?php the_title(); ?>
</a>
</h4>

 <?php the_excerpt(); ?>

 <?php endforeach; ?>

To utilize this feature this code will be placed in your template.  For me I put this in page.php just above the call to get_footer();

The reason I did this is so that if I create additional pages that will contain children this list will come after the content on those parent pages.  However, you can put this above ‘The Loop’ as well if you want this list to appear above your content.

If you have any questions about how this works or how to utilize this script, please post a comment.  Again this is my first how-to, so if I left out something major politely let me know and I will fix it.

Posted on 30 March '09 by Gabe, under How To, Wordpress. 8 Comments.

FHSU Foundation

jquery gallery

FHSU Foundation jquery gallery

This gallery was developed using jquery and Galleria.  Simple and to the point.

This page was created to  show work being done to Picken Hall.


FHSU Foundation header

FHSU Foundation header

The header graphic was created in Adobe Illustrator. The font is Garamound if I remember correctly.


FHSU Foundation navigation

FHSU Foundation navigation

The navigation bar was challenging. Rather than start from scratch I started with what someone had done previously in Dreamweaver. I may go back and redo the menu using jquery instead of Dreamweaver’s messy code, but it works well so I haven’t touched it. You’ll also see in another screen shot that I added sub links on the page itself so that if a user does not have javascript they will still be able to access all of the pages.

The drop down menu’s were created using a transparent gif. The ul blocks were given a negative margin in order to pull them up to cover the border of the main navigation bar, creating a seamless menu.


FHSU Foundation page

FHSU Foundation page

Here is just another large screen shot showing simple page elements. I didn’t get very fancy as the audience is alumni and professionals. Making the site easy to read was a high priority.

Posted on 11 March '09 by Gabe, under Portfolio. No Comments.

…and I’m redesigning again

So I haven’t been keeping my site up to date.  I’ve been awfully busy working as a consultant on a couple of web sites.  I’m also graduating in May, so you can guess that I probably won’t get much done here until after that.  I just wanted to put a post up to let you all know that I was still alive.  You can follow me on Twitter  if you want to keep up with what I’m doing.

Be on the lookout for my portfolio coming up in the next couple of months.

Posted on 10 March '09 by Gabe, under life in general. No Comments.