View Snippet
<?php
/*
Template Name: Our Work Main1
*/
$k_option['custom']['bodyclass'] = "class='fullwidth'"; //$k_option['custom']['bodyclass'] = "";
get_header(); ?>
<div id="main">
<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); // start loop
// THIS PAGE CAN ONLY DISPLAY FULLWIDTH PREVIEW PICTURES (940px * 420px)
//check if we got a previe picture, and which one should be taken (image resizing with "tim thumb" on? then we can take the big one and resize it)
$preview_big = get_post_meta($post->ID, "_preview_big", true);
$preview_medium = get_post_meta($post->ID, "_preview_medium", true);
//defaults:
$preview = $preview_big;
$lightbox = '';
$link = false;
$link_url = $preview_big;
if (!behance_is_file($preview_big,'image')) {$preview = $preview_medium;}
// the behance_build_image function used here checks if the image should be resized.
// the function is located in framework/helper_functions
$preview = behance_build_image(array('url'=>$preview,'height'=>'420','width'=>'940','lightbox'=>$lightbox,'link'=>$link));
?>
<div class='entry'>
<?php echo $preview; ?>
<div class="clearboth"></div>
<!------------------section-container------------------>
<div id="section-container">
<?php
$pages = get_pages('child_of='.$post->ID.'&parent='.$post->ID.'&sort_column
=menu_order&sort_order=asc');
foreach($pages as $page)
{ ?>
<div class="section-page">
<div class="section-thumb"><a href="<?php echo get_page_link($page->ID) ?>" title="<?php echo $page->post_title ?>">
<?php echo get_the_post_thumbnail($page->ID, array(150,100)); ?></a>
</div>
<div class="section-text">
<div class="section-desc"><?php echo get_post_meta($page->ID,
'section-desc', true); ?></div>
</div><!--section-text-->
</div><!--section-page-->
<?php } ?>
</div>
<!------------------section-container------------------> <div class="clearboth"></div>
<?php the_content(); ?>
<?php edit_post_link('Edit', '', ''); ?>
</div><!--end entry-->
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<!--do not delete-->
<?php endif; ?>
</div><!-- end content -->
<?php get_sidebar(); ?>
</div><!--end main-->
<?php get_footer(); ?>