<?php
$fields = get_post_custom();
if (isset($fields['gallery'])) {
   $images = split(',',$fields['gallery'][0]);
   $current = ($paged == '') ? 1 : $paged;
   $image = $images[$current-1];
?>
<div id="gallery">
   <img src="<?php echo $image; ?>" alt="<?php echo "Image $current of
".count($images); ?>" />
   <?php
   if (count($images) > 1) {
   ?>
   <ul>
       <?php if ($current > 1) { ?><li class="prev"><a href="<?php
the_permalink() ?>page/<?php echo $current-1; ?>">Previous
Image</a></li><?php } ?>
       <?php if ($current < count($images)) { ?><li class="next"><a
href="<?php the_permalink() ?>page/<?php echo $current+1; ?>">Next
Image</a></li><?php } ?>
   </ul>
   <?php } ?>
</div>
<?php } ?>
<?php
function get_work(
   $exclude=null,
   $limit=-1,
   $parent=3,
   $args = array('orderby'=>'menu_order',
'order'=>'ASC', 'post_type'=>'page')
) {
   $args['numberposts'] = $limit;
   if ($exclude) { $args['exclude'] = $exclude; }
   if ($parent) { $args['post_parent'] = $parent; }
   return get_posts($args);
}
?>
<?php
function list_work($exclude=null, $limit=-1, $parent=3, $args =
array('orderby'=>'menu_order', 'order'=>'ASC', 'post_type'=>'page')) {
   $work = get_work($exclude,$limit,$parent,$args);
   if ($work) : ?>
   <ul>
       <?php
       foreach ($work as $item) :
       $fields = get_post_custom($item->ID);
       ?>
       <li><a href="<?php echo get_permalink($item->ID) ?>">
          <img src="<?php echo $fields['tn'][0] ?>" alt="" />
          <?php echo apply_filters('the_title',$item->post_title); ?>
       </a></li>
       <?php endforeach; ?>
   </ul>
   <?php
   else : ?>
   <p>Our apologies, but we have yet to add any examples of our work.
Check back soon!</p>
   <?php endif;
} ?>
@EricCurtis
@meldel_pdx
@swestbrook
Slides and code snippets are posted at http://sticka.us/wcpdx09

I converse and emote on Twitter as @tylersticka

My blog and portfolio are at http://tylersticka.com

WordPress-Powered Portfolios

  • 61.
    <?php $fields = get_post_custom(); if(isset($fields['gallery'])) { $images = split(',',$fields['gallery'][0]); $current = ($paged == '') ? 1 : $paged; $image = $images[$current-1]; ?> <div id="gallery"> <img src="<?php echo $image; ?>" alt="<?php echo "Image $current of ".count($images); ?>" /> <?php if (count($images) > 1) { ?> <ul> <?php if ($current > 1) { ?><li class="prev"><a href="<?php the_permalink() ?>page/<?php echo $current-1; ?>">Previous Image</a></li><?php } ?> <?php if ($current < count($images)) { ?><li class="next"><a href="<?php the_permalink() ?>page/<?php echo $current+1; ?>">Next Image</a></li><?php } ?> </ul> <?php } ?> </div> <?php } ?>
  • 67.
    <?php function get_work( $exclude=null, $limit=-1, $parent=3, $args = array('orderby'=>'menu_order', 'order'=>'ASC', 'post_type'=>'page') ) { $args['numberposts'] = $limit; if ($exclude) { $args['exclude'] = $exclude; } if ($parent) { $args['post_parent'] = $parent; } return get_posts($args); } ?>
  • 68.
    <?php function list_work($exclude=null, $limit=-1,$parent=3, $args = array('orderby'=>'menu_order', 'order'=>'ASC', 'post_type'=>'page')) { $work = get_work($exclude,$limit,$parent,$args); if ($work) : ?> <ul> <?php foreach ($work as $item) : $fields = get_post_custom($item->ID); ?> <li><a href="<?php echo get_permalink($item->ID) ?>"> <img src="<?php echo $fields['tn'][0] ?>" alt="" /> <?php echo apply_filters('the_title',$item->post_title); ?> </a></li> <?php endforeach; ?> </ul> <?php else : ?> <p>Our apologies, but we have yet to add any examples of our work. Check back soon!</p> <?php endif; } ?>
  • 75.
  • 76.
  • 77.
  • 82.
    Slides and codesnippets are posted at http://sticka.us/wcpdx09 I converse and emote on Twitter as @tylersticka My blog and portfolio are at http://tylersticka.com